View Single Post
 
Old 11-09-2024, 11:06 AM
NoSparks NoSparks is offline Windows 10 Office 2010
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

I'm guessing a difference in Windows regional settings of dates and the way Excel is displaying them on the sheet.
Code:
Sub Scroll_to_current_date()

    Dim rngDate As Range

MsgBox Date & vbLf & vbLf & _
       "This is just to see what Windows has for Date format" & vbLf & _
       "if this differs from the sheet date formats" & vbLf & _
       "try changing LookIn:=xlValues to LookIn:=xlFormulas"

Set rngDate = Cells.Find(What:=Date, LookAt:=xlWhole, LookIn:=xlValues)

If Not rngDate Is Nothing Then
    '
    ' 'Scroll to the cell with the current date, Row / Column
    ' Application.Goto Reference:=rngDate, scroll:=True
    '
    'Scroll to the row with the current date.
    ActiveWindow.ScrollRow = rngDate.Row
    '
    ' 'Scroll to the column with the current date.
    ' ActiveWindow.ScrollColumn = rngDate.Column
End If

End Sub

Last edited by NoSparks; 11-09-2024 at 11:44 AM. Reason: included a sub that might help
Reply With Quote