Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Formats for date

I have a Woorkbook where I want VBA to change the name of a worksheet.
First, I have a french excel, but I want the date to appear in english...

So I can't find the format I must give him so that he puts the right date.

In excel, the Customized date would be "[$-1009]mmm jj, aaaa;@"
But that doesn't work if I put it in VBA. It gives me a full length month
(with all it's letters, and in french)
What I want is,for exemple: AUG 30, 2004
(Something like: Format(DateR, "mmm dd,yyyy"))
Month written with 3 letters.
Also, I'd like if It could me in capitals... can it be done?

Thank you for your help.

Marie


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Formats for date

Wow, I think I would have searched a long time to find that... still trying
to see what command does what, lol.

Thank you VERY MUCH.

Marie

"Stephen Bullen" a écrit dans le message de
...
Hi Marie,

I have a Woorkbook where I want VBA to change the name of a worksheet.
First, I have a french excel, but I want the date to appear in

english...

So I can't find the format I must give him so that he puts the right

date.

In excel, the Customized date would be "[$-1009]mmm jj, aaaa;@"
But that doesn't work if I put it in VBA. It gives me a full length

month
(with all it's letters, and in french)
What I want is,for exemple: AUG 30, 2004
(Something like: Format(DateR, "mmm dd,yyyy"))
Month written with 3 letters.
Also, I'd like if It could me in capitals... can it be done?

Thank you for your help.


Assuming the date value is in a variable dTheDate, you could use the
following:

sDate = UCase$(Application.Evaluate("TEXT(" & _
Str(CDbl(dTheDate)) & ",""[$-1009]mmm dd, yyyy"")")

Note that the number format uses US symbols for day, month and year.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Formats for date

Hi Marie,

I have a Woorkbook where I want VBA to change the name of a worksheet.
First, I have a french excel, but I want the date to appear in english...

So I can't find the format I must give him so that he puts the right date.

In excel, the Customized date would be "[$-1009]mmm jj, aaaa;@"
But that doesn't work if I put it in VBA. It gives me a full length month
(with all it's letters, and in french)
What I want is,for exemple: AUG 30, 2004
(Something like: Format(DateR, "mmm dd,yyyy"))
Month written with 3 letters.
Also, I'd like if It could me in capitals... can it be done?

Thank you for your help.


Assuming the date value is in a variable dTheDate, you could use the
following:

sDate = UCase$(Application.Evaluate("TEXT(" & _
Str(CDbl(dTheDate)) & ",""[$-1009]mmm dd, yyyy"")")

Note that the number format uses US symbols for day, month and year.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie


Reply
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
Different date formats David Biddulph[_2_] Excel Discussion (Misc queries) 0 December 8th 09 10:49 AM
Help with Date formats ROn Stalenberg[_2_] Excel Discussion (Misc queries) 1 September 10th 08 04:57 AM
Date formats Craig Excel Discussion (Misc queries) 2 January 10th 07 10:30 PM
date formats Steve Excel Discussion (Misc queries) 4 November 10th 06 04:44 PM
Date Formats Greenback Excel Discussion (Misc queries) 5 August 15th 06 08:32 AM


All times are GMT +1. The time now is 11:11 AM.

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"