View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Return ROW number from qa found range

Try something like

Dim FoundCell As Range
Dim WhatRow As Long
Columns("A:A").Select
Set FoundCell = Selection.Find(What:="Alabama",
After:=ActiveCell, _
LookIn:=xlFormulas, lookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If FoundCell Is Nothing Then
MsgBox "Not Found"
Else
WhatRow = FoundCell.Row
MsgBox "Found in row: " & WhatRow
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Mike" wrote in message
...
I have the following:

Columns("A:A").Select
Selection.Find(What:="Alabama", After:=ActiveCell,
LookIn:=xlFormulas,
lookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False).Activate

Now want to have a variable equal to the Row number that it
finds the text.