Reputation: 75
I have the following code:
Set rFinder = wkEnrollment.Range("EnrollmentIDs")
With Range(rFinder)
Set LastCell = .Cells(.Cells.Count)
End With
It errors when I do my With Range(rFinder)
line. rFinder
is dim'd as a Range
. The error is:
Method 'Range' of object '_Global' failed
I am not sure of the syntax on this?
Upvotes: 0
Views: 156
Reputation: 169314
Since rFinder
is already a Range object you should simply use:
Set rFinder = wkEnrollment.Range("EnrollmentIDs")
With rFinder
Set LastCell = .Cells(.Cells.Count)
End With
Upvotes: 1