In VBA why can't I search the entire row belonging to a specific cell?

I am using this code but I am getting an error. Any idea why?

Range("A9").EntireRow.Find(What:="*Market*", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlWhole)
shampouyaAsked:
Who is Participating?
 
Martin LissOlder than dirtCommented:
You really need something like this

Dim rngFound As Range
Set rngFound = Range("A9").EntireRow.Find(What:="*Market*", LookIn:=xlFormulas)

Open in new window

Note that I eliminated the 'After' parameter because if you don't have an active cell you'll get an error, and I eliminated the 'LookAt' parameter because if you are using wildcards in your search (as you are) it doesn't make sense to use xlWhole.
0
 
Saurabh Singh TeotiaCommented:
Try this...

Range("A9").EntireRow.Find(What:="*Market*", After:=cells(1,9) LookIn:=xlFormulas, LookAt:=xlWhole) 

Open in new window


Saurabh...
0
 
Roy CoxGroup Finance ManagerCommented:
It's not actually a good idea to search entire rows and columns so maybe

Range("A9").EntireRow.SpecialCells(xlCellTypeConstants).Find(What:="*Market*", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlWhole).Select

Open in new window


What error are you getting?
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
NorieVBA ExpertCommented:
What error are you getting?

Where's the rest of the code?
0
 
NorieVBA ExpertCommented:
The code on its own will cause a compile error, that's why I'm asking where the rest if the code is.
0
 
Martin LissOlder than dirtCommented:
I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
0
 
shampouyaAuthor Commented:
Already checked them out, very helpful articles. Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.