I am using the code below to do a vlookup on a column in a sheet in my work to pull in matching values from another.
Lets suppose in column A I have values in 500 rows. Is it possible to alter this code to ignore blanks, and continue copying the formula down to the row where the last value is conatined. Example, there was data in A2-A200, and then cells A201-A205 were blank, and then A206-A500 contained values. Instead of stopping at A200, can a macro continue down to A500 where the last value is present?
Sheets("Matching").Select
Dim LastRow As Long
LastRow = Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
Range("B2:B" & LastRow).FormulaR1C1 = "= VLOOKUP(RC[-1],'Old Map'!C[-1]:C[9],11,FALSE)"
Application.CutCopyMode = False
Lets suppose in column A I have values in 500 rows. Is it possible to alter this code to ignore blanks, and continue copying the formula down to the row where the last value is conatined. Example, there was data in A2-A200, and then cells A201-A205 were blank, and then A206-A500 contained values. Instead of stopping at A200, can a macro continue down to A500 where the last value is present?
Sheets("Matching").Select
Dim LastRow As Long
LastRow = Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlByRows).Row
Range("B2:B" & LastRow).FormulaR1C1 = "= VLOOKUP(RC[-1],'Old Map'!C[-1]:C[9],11,FALSE)"
Application.CutCopyMode = False