Hi,
I'm looking for a VBA code to locate column header and fill the values till last available row.
Attached sample sheet for reference.
In the attached sheet,
1) Locate column header using msg box1 from the available sheets of workbook (Eg, Find "Truck1")
2) Enter value(msgbox 2) - 1250
3) Enter currency(msgbox 3) - AED
4) Value and currency should be updated till last available row.
Please share your suggestions.
Found the below code in forum but not sure what to update. Please help
Code
Public Sub FindAndUpdate()
Dim i As Integer
Dim lastRow As Long
Dim myRng As Range
Dim mycell As Range
Dim MyColl As Collection
Dim myIterator As Variant
Set MyColl = New Collection
MyColl.Add "Some Value"
MyColl.Add "Another Value"
lastRow = ActiveSheet.Cells.Find("*", SearchOrder:=xlB Rows, SearchDirection:=xlPrevious).Row
For i = 1 To 200
For Each myIterator In MyColl
If Cells(1, i) = myIterator Then
Set myRng = Range(Cells(2, i), Cells(lastRow, i)) For Each mycell In myRng
mycell.Value = Val(mycell.Value)
Next
End If
Next
Next
End Sub
Display More