Date Format Problem
From: Markus Scheible (anonymous_at_discussions.microsoft.com)
Date: 02/09/05
- Next message: VBA Dabbler: "Re: Clearing objects in a VBProject"
- Previous message: donotSpam: "Re: Start macro by Command Button?"
- In reply to: Mario: "Date Format Problem"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Feb 2005 06:53:10 -0800
Hi Markus,
I assume your problem is caused by the automatically
changing of a cell format within excel.
>message box displays 01/02/2005 as it should but when the
value is placed in
>a cell it changes to 02/01/2005. I have tried this with
>Sub WRITEDATE()
>Dim dateandtime As String
>
>dateandtime = "01/02/2005 08:35"
>date1 = Left(dateandtime, 10)
>MsgBox date1 'to test
>Cells(1, 1) = date1 'have tried cells(1,1).value=date1
but same results
Try range("A1").Value = date1
and go to Format => Cells => Number => Custom => TT/MM/JJJJ
Best
Markus
>
>End Sub
>---------------------
>.
>
- Next message: VBA Dabbler: "Re: Clearing objects in a VBProject"
- Previous message: donotSpam: "Re: Start macro by Command Button?"
- In reply to: Mario: "Date Format Problem"
- Messages sorted by: [ date ] [ thread ]