Hello Friends & Community,
Seeking Help again, I am trying to do a vlookup VBA, the reference data is in another workbook. I was thinking to assign variable for the data workbook & worksheet, but wasnt able to make it work. The sub can run successfully, but do not return any result in the desired worksheet. Please help!
Explanations:
WbVlookup is the variable for vlookup data workbook
BuildplanRange is the varibale for vlookup data range
The result need to run from Row 14 to the last result row
Thoughts of mine: It seems to me the variable wasnt assigned correctly for both workbook and datarange, but i wasn't able to figure out what was wrong with the syntax, so hoping somebody can help
Sub VlookupForColumnGHIJ()
Dim EndofRow As Long
Dim RowX As Integer
Dim WbVlookup As Workbook
Dim BuildplanRange As Range
Set WbVlookup = Workbooks.Open("C:\Users\DengSilin\Downloads\Copy of 98289 (FL512S)_Allocation File_WW18 (002)_Cindy_02022021.xlsx")
Set BuilPlanRange = WbVlookup.Worksheets("Build Plan").Column("F:I")
EndofRow = Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row
For RowX = 14 To EndofRow
Cells(RowX, 6) = Application.WorksheetFunction.VLookup(Cells(RowX, 3), BuilPlanRange, 2, 0)
Next RowX
End Sub