![]() |
|
|
|
#1
|
||||
|
||||
|
Hi @all,
I have the same version of Excel on both PCs. The following is not running on one workstation: Code:
Set rngDate = Cells.Find(What:=Date, LookAt:=xlWhole, LookIn:=xlValues) Code:
Sub Zum_aktuellen_Datum_scrollen()
Dim rngDate As Range
Set rngDate = Cells.Find(What:=Date, LookAt:=xlWhole, LookIn:=xlValues)
If rngDate Is Nothing = False Then
'
' 'Zur Zelle, mit dem aktuellen Datum scrollen, Row / Column
' Application.Goto Reference:=rngDate, scroll:=True
'
'Zur Zeile, mit dem aktuellen Datum scrollen.
ActiveWindow.ScrollRow = rngDate.Row
'
' 'Zur Spalte, mit dem aktuellen Datum scrollen.
' ActiveWindow.ScrollColumn = rngDate.Column
End If
End Sub
|
|
#2
|
|||
|
|||
|
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 |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Convert a word VBA code to PowerPoint VBA code
|
laith93 | Word VBA | 5 | 11-09-2023 08:40 AM |
Problem with ZIP code serial printing
|
Kuzcomerlin | Mail Merge | 3 | 01-22-2020 02:12 PM |
Problem with currency field code
|
DIYman | Mail Merge | 2 | 09-22-2015 12:16 AM |
Start of Document Code Problem
|
norgro | Word VBA | 2 | 02-12-2013 04:03 AM |
| Custom formatting code - rounding problem | venkys4u | Excel | 1 | 08-14-2012 07:45 PM |