Magix,
MyDate = Format(Date, "mmddyyyy")
MyTime = Format(Time, "hhmmss")
Or you could use dashes for readability:
MyDate = Format(Date, "mm-dd-yyyy")
MyTime = Format(Time, "hh-mm-ss")
Earl Kiosterud
www.smokeylake.com
"magix" <(E-Mail Removed)> wrote in message
news:439b924d$(E-Mail Removed)...
> Hi,
>
> in Excel VBA coding,
> How can I create new worksheet name with System DateTime ? Because I
> understand the name can not have some special character like colon :
>
> E.g Let say now is Dec 11, 2005 1:30:29 pm. It needs to put into string
> format
>
> So it will be 12112005133029
>
> Something like:
>
> Dim MyDate as String
> Dim MyTime as String
> MyTime = Time
> MyDate = Date
>
> .... after formating
> wsNew.Name = MyDate & MyTime
>
> Please help. Thanks.
>
> Regards, Magix
>
>