So I thought I had an OK grasp of VBA but now this error is really bugging me and I can't figure out the problem. Here is an incredibly short subroutine (run from a module):
Sub test()
Dim lr
lr = Sheets(1).Range("a1", Cells(65, 1))
MsgBox lr.Address
End Sub
For whatever reason this throws up an "application defined/object defined error"
can anyone explain?
Edit: This also throws up the same error:
MsgBox Sheets(1).Range("a1", Cells(65, 1)).Address
Edit2: I'm going to change my question a bit as I understand about the object thing but I what to use it with the "find" method. So here is the code:
Set lookrange = Sheets(1).Range(Cells(2, 1), Cells(200, 1))
Set result = lookrange.Find(what:=searchTerm, lookat:=xlWhole)
In this case it tells me lookrange is causing a problem.