suresh ullanki
Board Regular
- Joined
- Apr 29, 2013
- Messages
- 67
Hi, Can somebody correct following code for vlookup. am trying to lookup from sheet1 to sheet2.
Sub findmrp3()
Dim lastrow As Long
Dim i As Integer
lastrow = Worksheets("sheet2").Range("b" & Rows.Count).End(xlUp).Row
Set myrange = Worksheets("Sheet1").Range("b:j")
For i = 2 To lastrow
Cells(i, 3) = Application.WorksheetFunction.VLookup(Cells(i, 2), myrange, 9, 0)
Next i
End Sub
Sub findmrp3()
Dim lastrow As Long
Dim i As Integer
lastrow = Worksheets("sheet2").Range("b" & Rows.Count).End(xlUp).Row
Set myrange = Worksheets("Sheet1").Range("b:j")
For i = 2 To lastrow
Cells(i, 3) = Application.WorksheetFunction.VLookup(Cells(i, 2), myrange, 9, 0)
Next i
End Sub