Vlookup in Procedure...I'm begging you to help...
Posted by Tim on February 07, 2002 6:29 AM
Here is my code
Sub CopySegments()
Dim R As Integer
R = Sheets("Total").Range("b65536").End(xlUp).Row
For i = 2 To R
Sheets("Total").Cells(i, 13).Value = _
Application.WorksheetFunction.VLookup(Sheets("Total").Cells(i, 2).Value, _
Sheets("MDMS Data").Range("c2:p100"), 2, 1)
Next i
End Sub
It bombs because it says it can't find the Vlookup something. The thing is, when I set the range in the Vlookup function to Sheets("MDMS Data").UsedRange, it works just fine. I don't want UsedRange though, I want a specific range. What's the problem?