DFragnDragn
Board Regular
- Joined
- Mar 6, 2010
- Messages
- 81
I have a 12 month calendar. All 12 months are within Range C5:Y39.
FindString = Format(dValue, "d") is only finding the first instance (current Day) which is Jan.
Changing the format value to "m" gets me into Feb., but with the wrong day. I've tried every Format value I can think of and they all fail completely except for d & m.
I can't get it to find the proper month with appropriate day.
Any direction would be much appreciated.
FindString = Format(dValue, "d") is only finding the first instance (current Day) which is Jan.
Changing the format value to "m" gets me into Feb., but with the wrong day. I've tried every Format value I can think of and they all fail completely except for d & m.
I can't get it to find the proper month with appropriate day.
Any direction would be much appreciated.
Code:
Sub FindDate()
Dim FindString As String
Dim Rng As Range
Dim dValue As String
dValue = Date
FindString = Format(dValue, "d")
If Trim(FindString) <> "" Then
With ActiveSheet.Range("C5:Y39")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
MsgBox Rng.Value
Application.Goto Rng
Else
MsgBox "Nothing found"
End If
End With
End If
End Sub