Hi folks,
Hopefully someone out there can help.
I have a list to vlookup which works (ish). the lookup only picks up the first instance of the source and not all instances.
the code i have that doesnt work completely
Dim Rw As Long
Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Dim WsF As Object
Set WsF = Application.WorksheetFunction
Set ws1 = ThisWorkbook.Sheets("dump")
Set ws2 = ThisWorkbook.Sheets("batch_list")
Set ws3 = ThisWorkbook.Sheets("output")
For Rw = 1 To 1000
On Error Resume Next
ws3.Cells(Rw, "A") = WsF.VLookup(ws2.Cells(Rw, "A"), ws1.Range("A1:b30000"), 2, False)
Next Rw
For Rw = 1 To 27
On Error Resume Next
ws3.Cells(Rw, "c") = WsF.VLookup(ws2.Cells(Rw, "A"), ws1.Range("d1:e30000"), 2, False)
Next Rw
any help or guidance much appreciated as normal
thanks in advance
Hopefully someone out there can help.
I have a list to vlookup which works (ish). the lookup only picks up the first instance of the source and not all instances.
source | requested | output |
table-500227table--500227/line-110/output_2 | 500227 | table-500227table--500227/line-110/output_2 |
table-500227table--500227/line-120/output_2 | 500163 | table-500163table--500163/line-110/output_2 |
table-500227table--500227/line-130/output_2 | 500165 | table-500165table--500165/line-110/output_2 |
table-500163table--500163/line-110/output_2 | ||
table-500163table--500163/line-120/output_2 | ||
table-500163table--500163/line-130/output_2 | ||
table-500165table--500165/line-110/output_2 | ||
table-500165table--500165/line-120/output_2 |
the code i have that doesnt work completely
Dim Rw As Long
Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
Dim WsF As Object
Set WsF = Application.WorksheetFunction
Set ws1 = ThisWorkbook.Sheets("dump")
Set ws2 = ThisWorkbook.Sheets("batch_list")
Set ws3 = ThisWorkbook.Sheets("output")
For Rw = 1 To 1000
On Error Resume Next
ws3.Cells(Rw, "A") = WsF.VLookup(ws2.Cells(Rw, "A"), ws1.Range("A1:b30000"), 2, False)
Next Rw
For Rw = 1 To 27
On Error Resume Next
ws3.Cells(Rw, "c") = WsF.VLookup(ws2.Cells(Rw, "A"), ws1.Range("d1:e30000"), 2, False)
Next Rw
any help or guidance much appreciated as normal
thanks in advance