View Single Post
  #3   Report Post  
Harald Staff
 
Posts: n/a
Default

Hi

One workbook is set to 1900 calendar format (=Windows default calendar). The
other is set to 1904 calendar (Mac). You can do this in the Tools Options
menu in Windows Excel, and in Excel Preferences (I think) on a Mac Excel.

The difference between those standards is 1462 days. You can not end this
error in a mixed environment without brute force, but it's easy to convert
from one standard to another by selecting the date cell(s) and run the
proper macro:

Sub Date1900to1904()
Dim Cel As Range
For Each Cel In Selection
If Cel.HasFormula = False Then
If IsDate(Cel.Value) Then
Cel.Value = Cel.Value - 1462
End If
End If
Next
End Sub

Sub Date1904to1900()
Dim Cel As Range
For Each Cel In Selection
If Cel.HasFormula = False Then
If IsDate(Cel.Value) Then
Cel.Value = Cel.Value + 1462
End If
End If
Next
End Sub

HTH. Best wishes Harald


"rrjohnsonia" skrev i melding
...
I often copy cell contents from one worksheet and post them into a new

one.
When I copy one set of dates and paste them into a new worksheet, the date
falls back one day and to 2001. For example, an original date of May 30,

2005
copies as May 29, 2001.

Our agency's IT guru can't figure it out. I could use some help to end

this
frustrating error.

Thanks.