Tuesday, June 8, 2010

Go to current date upon opening Worksheet

Go to current date upon opening Worksheet
Macro written by Ron deBruin.......with slight modifications.

Copy/paste to a General Module.

Sub Find_Todays_Date()
Dim FindString As Date
Dim rng As Range
FindString = Date
With ActiveSheet.Range("A:A")
Set rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
If Not rng Is Nothing Then
Application.Goto rng, True
MsgBox "Nothing found"
End If
End With
End Sub

Place the following in the sheet module.

Private Sub Worksheet_Activate()
Call Find_Todays_Date
End Sub

BTW..........A is not a row. A is a column.


Post a Comment