3) Table 1 and 2 in different books and different sheets.


Option Explicit
Sub VlookUpExampleDifferBooks()
'This example look up table in different book and sheet (TABLE 1 - ActiveSheet, TABLE 2 - Book1 and sheet1)
Dim rw As Long
For rw = 3 To 12
Cells(rw, 3) = Application.VLookup(Cells(rw, 2), Workbooks("Book2.xls").Sheets("Sheet1").Columns("B:C"), 2, False)
Next
End Sub

Comments

Popular posts from this blog

50 Excel VBA Oral Interview Questions