LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Date formatting

I don't have international programming experience, so I don't know if this
will always return the American date ordering (mm-dd-yyyy) or if it will
adjust to the local date preference of dd-mm-yyyy, but the Date function has
an alternate form that always outputs dashes instead of slashes... just add
a $ sign to the end of it.

Sheets("IDT (2)").Name = Date$

If this does always produce the American ordering, then use the Format
function as suggested by others.

By the way, if you do try this, could you post back whether the order is
local aware (did it put the month/day in the order you expected) or not so
that I will know for the future? Thanks

--
Rick (MVP - Excel)



"lasca" wrote in message
...
I want to use a date for as an sheet name, Ie 13-Sep-08 or 13-09-08 ( this
will be set by using vb code).
My problem is the system date is in dd/mm/yyyy format and the "/" can not
be
used for sheetname. How do i go about replacing the "/" with "-" in my vb
code so that it wil be an acceptable format.

Here is my code that I used


Dim SHEETNAME As String

SHEETNAME = Date

Sheets("IDT").Select
Sheets("IDT").Copy After:=Sheets(2)
Sheets("IDT (2)").Name = SHEETNAME



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
date formatting Ryan Excel Discussion (Misc queries) 6 December 21st 06 02:33 AM
Date formatting Katie Excel Discussion (Misc queries) 5 November 4th 06 09:09 PM
Date formatting help [email protected] Excel Discussion (Misc queries) 3 September 6th 06 12:45 AM
Date Colum Date Formatting & Validation Mike[_81_] Excel Programming 1 June 7th 04 01:59 AM


All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"