Thread: find row number
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mel Arquiza Mel Arquiza is offline
external usenet poster
 
Posts: 17
Default find row number

Hi Choice,

Try this macro if this works for you.

1. Select all data or range you are interested to find and run the macro
below.

Sub SelectStringCells()
Dim rCell As Range
Dim IString As String
Dim rSelected As Range

IString = "1/12/2001"

Set rSelected = Nothing
For Each rCell In Selection
If rCell.Value = IString Then
If rSelected Is Nothing Then
Set rSelected = rCell
Else
Set rSelected = Union(rSelected, rCell)
End If
End If
Next
If rSelected Is Nothing Then
MsgBox "No cells value match"
Else
rSelected.Select
MsgBox "Found the Dates"
End If
Set rCell = Nothing
Set rSelected = Nothing
End Sub

Hope this helps.

"choice" wrote:

in row A i have dates (multiple, but ascending)
i need to find the row that first contains a date and the last row that
contains that same date

thanks in advance