peteryau
asked on
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
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
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?
activesheet.range("A:A").f
A simple solution
Dim foundRow As Long
Cells.Find("find_me", Range("A1"), , xlByColumns).Activate
foundRow = ActiveCell.Row
MsgBox foundRow
Although ssagibh's solution is simpler and better. I always forget the really easy methods!
ASKER
Yes, the word find_me is case sensitive and only of the word "find_me"
ASKER
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"
ssagibh's solution shows the row number of "find_me_too" which occurs before "find_me"
activesheet.range("A:A").f ind("find_ me",,,xlwh ole).row
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.