Excel VBA: Use a range object variable in the Find method?

No replies
User offline. Last seen 2 years 50 weeks ago. Offline
Joined: 06/06/2009
Posts: 7

I have the following:

Dim taskNoSchI As Range
Dim concat2008 As Range
Dim totalCosts As Range

Set taskNoSchI = ActiveCell
Set concat2008 = Sheets(4).Columns(4).find(what:=taskNoSchI, After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
MsgBox concat2008

I am using "taskNoSchI" as the first argument of the "find" method after "what:="
I can't figure out why this isn't working. I used a string variable in its place and that worked. I think the problem might be that this variable holds an object (range object).

Any ideas why taskNoSchI wouldn't work?