Store row number after a find

A

Alan

Following a find command I want to store the row number to a variablke and
use that to move to a columb on that row
 
A

Alan

Hello,

Any column on that row. Real problem is storing the 'found' row number to a
variable
 
F

FSt1

hi,
if you are using the built in find then you do have a problem. try this...
Sub macfindrow()
dim rn as string
dim rng as range
dim therow as long

rn = inputbox("enter something to find")
if rn <> "" then
Set rng = nothing
Set rng = range("A1:IV65536").Find(what:=rn, _
After:=Range("A1"), _
Lookin:=xlformulas, _
Lookat:=xlpart, _
SearchOrder:=xlbyrows, _
SearchDirection:=xlNext, _
MatchCase:=false)
end if
therow = rng.row
msgbox "Found at cell " & rng.address
msbbox "The row number is " & therow
end sub

therow is the variable

Regards
FSt1
 
A

Alan

Dear FSt1,

Thanks very good. I have modified slightly and now all is OK.

What does FSt1 mean or stand for ?

Alan
 
A

Alan

Frank,

Can you help with an embelishment to your solution. How can I trap a NO FIND
following the find command you supplied
 
Top