View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default identify whic row contains todays date

Hi John,

Lookup FindNext in Help if you need to find more than one occurrence of
today's date.

Sub FindToday()

Dim dateToday As Date
Dim rngColB As Range
Dim rngToFind As Range

dateToday = Date

With Sheets("Sheet1")
Set rngColB = .Range("B:B")
End With

With rngColB
Set rngToFind = .Find(What:=dateToday, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
End With
If Not rngToFind Is Nothing Then
'insert your code here in lieu of
'following 2 lines if date found
rngToFind.Select
MsgBox "Found value"
Else
MsgBox "Did not find value"
Exit Sub
End If

End Sub

--
Regards,

OssieMac