Need help to get my code corrected. I need the Column C values onto my "working sheet Column B" based on the string value that is "column B in entity sheet". vlookup value would be the entity ID in column A.
EDIT: Fixed VBA code
VBA Code:
Set sht = ActiveWorkbook.Worksheets("working sheet")
Set sht1 = ActiveWorkbook.Worksheets("entity sheet")
LR = sht.UsedRange.Rows.Count
With sht
For i = 2 To LR
If InStr(sht1.Range("B" & i).Value, "WS") Then
sht.Range("B" & i).Value = (Application.VLookup(.Range("A" & i).Value, Worksheets("entity sheet").Range("A2:C5000"), 3, False))
End If
Next i
End With
EDIT: Fixed VBA code
Last edited by a moderator: