Using Excel 2000, WinXP.
I want to write a macro that does a Paste Special Add or Subtract of a stored constant (1462) to a selected range of cells with dates in them. This is to convert between 1900 and 1904 date systems (i.e. Win Vs. Mac). Here's my simple effort (below). It doesn't work though - it won't compile past the "Deltat_date.Copy" line.
I know this is a really basic syntax question, but I program about once a year, and am having trouble finding a quick explanation in my references. Any guidance would be much appreciated!
Thank you
Peter L.
=============================================
Sub date_1904()
' date_1904 Macro
Private Const Delta_date As Integer = 1462
Delta_date.Copy
Selection.PasteSpecial Paste:=xlAll, Operation:=xlSubtract, SkipBlanks:= _
False, Transpose:=False
Selection.NumberFormat = "mm/dd/yy"
End Sub
I want to write a macro that does a Paste Special Add or Subtract of a stored constant (1462) to a selected range of cells with dates in them. This is to convert between 1900 and 1904 date systems (i.e. Win Vs. Mac). Here's my simple effort (below). It doesn't work though - it won't compile past the "Deltat_date.Copy" line.
I know this is a really basic syntax question, but I program about once a year, and am having trouble finding a quick explanation in my references. Any guidance would be much appreciated!
Thank you
Peter L.
=============================================
Sub date_1904()
' date_1904 Macro
Private Const Delta_date As Integer = 1462
Delta_date.Copy
Selection.PasteSpecial Paste:=xlAll, Operation:=xlSubtract, SkipBlanks:= _
False, Transpose:=False
Selection.NumberFormat = "mm/dd/yy"
End Sub