Hello All,
I am trying to work with this vlookup in VBA but it's failing .
The range where the vlook up is looking for value of entries in column C is kept on a separate sheet called "Site ID to Cell ID" and in range A2 to B30287 . This worksheet is part of the same workbook.
the code is failing to return a value for the vlookup.
here is the code:
Thanks
Syed
I am trying to work with this vlookup in VBA but it's failing .
The range where the vlook up is looking for value of entries in column C is kept on a separate sheet called "Site ID to Cell ID" and in range A2 to B30287 . This worksheet is part of the same workbook.
the code is failing to return a value for the vlookup.
here is the code:
Code:
r=2
lastrow = Worksheets("NR_Best server by SS-RSRP").Cells.SpecialCells(xlCellTypeLastCell).Row
With Worksheets("NR_Best server by SS-RSRP")
For r1 = r To lastrow
.Cells(r1, 3) = Left(.Cells(r1, 2), Len(.Cells(r1, 2)) - 6)
.Cells(r1, 5) = Right(.Cells(r1, 2), 5)
.Cells(r1, 6) = .Cells(r1, 4) & "N" & .Cells(r1, 5)
.Cells(r1, 7) = .Cells(r1, 4) & .Cells(r1, 5)
.Range("D" & r1) = Application.WorksheetFunction.VLookup(Range("C" & r1), Worksheets("Site ID to Cell ID").Range("A2:B30287"), 2, False)
Next
End With
Thanks
Syed