marcro to assign a variable to the row number of a cell contains a particular word

HI
I want to assign an variable  in excel marco which returns  the row number of a cell in Colume A with the word "find_me".  The word "find_me only exist one time in column A.
How can I do it?

Thanks
Peter
peteryauAsked:
Who is Participating?
 
Saqib Husain, SyedConnect With a Mentor EngineerCommented:
activesheet.range("A:A").find("find_me",,,xlwhole,,,true).row

will also match the case
0
 
andrewssd3Commented:
Does the cell consist only of the word "find_me", or does it just contain the word, like "can you find_me in this cell".  Are you worried about upper or lower case?
0
 
Saqib Husain, SyedEngineerCommented:

activesheet.range("A:A").find("find_me").row
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
TinTombStoneCommented:
A simple solution

Dim foundRow As Long

    Cells.Find("find_me", Range("A1"), , xlByColumns).Activate

    foundRow = ActiveCell.Row

    MsgBox foundRow

Open in new window

0
 
TinTombStoneCommented:
Although ssagibh's solution is simpler and better.  I always forget the really easy methods!
0
 
peteryauAuthor Commented:
Yes, the word find_me is case sensitive and only of the word "find_me"
0
 
peteryauAuthor Commented:
how to show the row number  which has exactly the value "find_me"?
ssagibh's solution shows the row number of "find_me_too"  which occurs before "find_me"
0
 
Saqib Husain, SyedEngineerCommented:
activesheet.range("A:A").find("find_me",,,xlwhole).row
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.