ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Simple... Using FIND, I need to get the row and cell (https://www.excelbanter.com/excel-programming/441909-simple-using-find-i-need-get-row-cell.html)

GEdwards

Simple... Using FIND, I need to get the row and cell
 
Using the FIND below, what do I need to get the row and cell where I find the
match in column B?

With Sheets("Sheet1").Range("B:B")
Set Rng = .Find(What:="I-100421224950", _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)

GEdwards

Simple... Using FIND, I need to get the row and cell
 
It's OK, I got it! Just needed to continue with

If Not Rng Is Nothing Then
Application.Goto Rng, True
MsgBox ActiveCell.Row & "." & ActiveCell.Column
End

"GEdwards" wrote:

Using the FIND below, what do I need to get the row and cell where I find the
match in column B?

With Sheets("Sheet1").Range("B:B")
Set Rng = .Find(What:="I-100421224950", _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)


L. Howard Kittle

Simple... Using FIND, I need to get the row and cell
 
Try this::

Sub FindaBunchOnumbers()
Columns("B:B").Find(What:="I-100421224950", _
After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

MsgBox ActiveCell.Address
End Sub

Modified from the macro recorder.

HTH
Regards,
Howard

"GEdwards" wrote in message
...
Using the FIND below, what do I need to get the row and cell where I find
the
match in column B?

With Sheets("Sheet1").Range("B:B")
Set Rng = .Find(What:="I-100421224950", _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)




Rick Rothstein

Simple... Using FIND, I need to get the row and cell
 
You don't have to go to the cell (unless you want to); you could have
continued this way instead...

If Not Rng Is Nothing Then
MsgBox Rng.Row & "." & Rng.Column
End If

--
Rick (MVP - Excel)



"GEdwards" wrote in message
...
It's OK, I got it! Just needed to continue with

If Not Rng Is Nothing Then
Application.Goto Rng, True
MsgBox ActiveCell.Row & "." & ActiveCell.Column
End

"GEdwards" wrote:

Using the FIND below, what do I need to get the row and cell where I find
the
match in column B?

With Sheets("Sheet1").Range("B:B")
Set Rng = .Find(What:="I-100421224950", _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)




All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com