Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hoe can I determine the Row # in a search 1

Status
Not open for further replies.

snoopy80

Technical User
Jun 27, 2001
106
I have a search
Cells.Find(What:="n", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End Sub

When it find "n" how can I determine what row is "n" in. I need to use this row number to referrence another cell in the same row but different column. For example, if "n" is in Cells(65, 2) then I need to see if Cells(65, 4) is empty or not if it is, I will delete it.
Thanks for helps.
 
Something like this ?
ActiveCell.Offset(0, 2)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 


Hi,

Rather than Selecting or Activating...
Code:
Dim rng as range, lTheRow as long, iTheCol as integer
set rng = Cells.Find(What:="n", After:=ActiveCell, LookIn:=xlValues, LookAt:= _
        xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
        , SearchFormat:=False)
if not rng is nothing then
   'houston, we FOUND it!
   with rng
      lTheRow = .row
      iTheCol = .Column
   end with
end if


Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Thanks PH and Skip.

This is exactly what I need. Thanks Skip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top