Go to current date upon opening Worksheet
Hi Jason,
Here is the exact code I use at my side.
Sub Find_Todays_Date()
Dim FindString As Date
Dim rng As Range
FindString = "2006-8-19"
With ActiveSheet.Rows(1)
Set rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
Application.Goto rng, True
Else
MsgBox "Nothing found"
End If
End With
End Sub
1. I build a Worksheet as your suggestion
A B C D E
16-Aug 17-Aug 18-Aug 19-Aug 20-Aug
2. Select any one cell but not the cell 19-Aug
3. Run the macro above, the cell " 19-Aug" will be selected.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
|