Macro for Todays date

Occasional Contributor

Hi everyone!


I am very very new to Macros and am trying to do the following:

Add a macro (that I can then add to a button) that when I click it, it automatically finds todays date in column A, and then scrolls to place that cell directly at the top of the list, being that I have frozen the panes at the top. I have conditionally formatted so that the row with todays date in turns pink.


So you can see the picture below showing various dates in column A, and then todays date in pink further down. I want it so I can click a macro and it automatically does what you can see in then next picture, scroll to place 'today' just under row 7 (where panes are frozen).






Can anyone help?


Thank you in advance!



4 Replies
best response confirmed by Andrew_Hinson (Occasional Contributor)


Try this macro:

Sub GoToToday()
    Dim rng As Range
    Set rng = Range("A:A").Find(What:=Date, LookIn:=xlFormulas)
    If rng Is Nothing Then
        Application.Goto rng, True
    End If
End Sub

@Hans Vogelaar absolutely amazing, works perfectly! Thank you so much :). Any recommendations on where I can start for learning Macros?

That's great, thank you very much.