Hello !
I was trying to apply Vlookup on a new column created with the reference table in another workbook.
What I'm trying to achieve:
> Column S in "Working IC" workbook, with sheet "Subs Console" has the Party Name column from where I want to compare the Party names from another workbook "MacroRUN.xlsm" havin sheet "Party Name".
> Sheet "Party Name" has column A similar to column S in "Subs Console" sheet of another workbook.
> Sheet "Party Name" has column B which we want to lookup and apply on sheet "Subs Console" of another workbook in column AZ with reference to Party name.
I was trying to apply Vlookup on a new column created with the reference table in another workbook.
What I'm trying to achieve:
> Column S in "Working IC" workbook, with sheet "Subs Console" has the Party Name column from where I want to compare the Party names from another workbook "MacroRUN.xlsm" havin sheet "Party Name".
> Sheet "Party Name" has column A similar to column S in "Subs Console" sheet of another workbook.
> Sheet "Party Name" has column B which we want to lookup and apply on sheet "Subs Console" of another workbook in column AZ with reference to Party name.
Code:
ActiveSheet.UsedRange.AutoFilter Field:=48, Criteria1:="AP"
Dim ws As Worksheet
Set ws = Sheets("Subs Console")
Windows("Working IC.xlsx").Activate
Sheets("Subs Console").Select
Dim c As Range
For Each c In ws.UsedRange.Columns("AZ").Cells
On Error Resume Next
c.Value = Application.WorksheetFunction.VLookup(c, Sheets("Party Name").Range("A:B"), 2, False)
Next c
Last edited: