Hello All,
Can anyone tell me why the following fails? I am trying to improve efficiency by replacing part of the 'Find' range with the variable lRow, but it fails unless I use a specified range.
If I change the range back to "A61500:A65500" it works just fine.
Thanks,
David
Can anyone tell me why the following fails? I am trying to improve efficiency by replacing part of the 'Find' range with the variable lRow, but it fails unless I use a specified range.
Code:
Dim name As String
Dim Loc As Range
Dim x As Integer
Dim lRow As Integer
On Error Resume Next
x = 0
lRow = 61501
Do Until x = 251
name = ActiveCell.Offset((addRows + 1) * -1, 0).Value
Set Loc = Range("A" & lRow - 5 & ":A65500").Find(What:=name, LookIn:=xlValues, Lookat:=xlWhole)
ActiveCell.Value = Loc.Offset(0, cCol).Value
x = x + 1
lRow = Loc.Row
ActiveCell.Offset(0, 1).Select
Thanks,
David