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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
NorieAnalyst Assistant Commented:
What error are you getting?

Where's the rest of the code?
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NorieAnalyst Assistant Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.