Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Date formatting

Excel 2003
I have dates in Cells B4 (10 March 2007) and F4 (20 October 2007).
Formatting is "dd mmmm yyyy".

I have, as part of a macro:-
Range("A1").Value = "You have selected rounds between '" & Range("B4") & _
"' and '" & Range("F4") & "'"

which produces:-
You have selected rounds between '10/03/2007' and '20/10/2007'

I would like it to read:-
You have selected rounds between '10 March 2007' and '20 October 2007'.

How can I adjust my code to produce this result?
Sandy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Date formatting

Sandy,

Try this

Range("A1").Value = "You have selected rounds between '" _
& Format(Range("B4"), "DD MMMM YY") & "' and '" & Format(Range("F4"), _
"DD MMMM YYYY") & "'"

Mike

"Sandy" wrote:

Excel 2003
I have dates in Cells B4 (10 March 2007) and F4 (20 October 2007).
Formatting is "dd mmmm yyyy".

I have, as part of a macro:-
Range("A1").Value = "You have selected rounds between '" & Range("B4") & _
"' and '" & Range("F4") & "'"

which produces:-
You have selected rounds between '10/03/2007' and '20/10/2007'

I would like it to read:-
You have selected rounds between '10 March 2007' and '20 October 2007'.

How can I adjust my code to produce this result?
Sandy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default Date formatting

Ah the parentheses make all the difference - I nearly had it.
Thank you very much Mike
Sandy

"Mike H" wrote in message
...
Sandy,

Try this

Range("A1").Value = "You have selected rounds between '" _
& Format(Range("B4"), "DD MMMM YY") & "' and '" & Format(Range("F4"), _
"DD MMMM YYYY") & "'"

Mike

"Sandy" wrote:

Excel 2003
I have dates in Cells B4 (10 March 2007) and F4 (20 October 2007).
Formatting is "dd mmmm yyyy".

I have, as part of a macro:-
Range("A1").Value = "You have selected rounds between '" & Range("B4") &
_
"' and '" & Range("F4") & "'"

which produces:-
You have selected rounds between '10/03/2007' and '20/10/2007'

I would like it to read:-
You have selected rounds between '10 March 2007' and '20 October 2007'.

How can I adjust my code to produce this result?
Sandy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Date formatting

Your welcome and thanks for the feedback

"Sandy" wrote:

Ah the parentheses make all the difference - I nearly had it.
Thank you very much Mike
Sandy

"Mike H" wrote in message
...
Sandy,

Try this

Range("A1").Value = "You have selected rounds between '" _
& Format(Range("B4"), "DD MMMM YY") & "' and '" & Format(Range("F4"), _
"DD MMMM YYYY") & "'"

Mike

"Sandy" wrote:

Excel 2003
I have dates in Cells B4 (10 March 2007) and F4 (20 October 2007).
Formatting is "dd mmmm yyyy".

I have, as part of a macro:-
Range("A1").Value = "You have selected rounds between '" & Range("B4") &
_
"' and '" & Range("F4") & "'"

which produces:-
You have selected rounds between '10/03/2007' and '20/10/2007'

I would like it to read:-
You have selected rounds between '10 March 2007' and '20 October 2007'.

How can I adjust my code to produce this result?
Sandy


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
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
Date formatting Hawksby Excel Discussion (Misc queries) 2 December 15th 06 02:45 PM
Date formatting Katie Excel Discussion (Misc queries) 5 November 4th 06 09:09 PM
Date Formatting Mahmoud Metwaly Excel Discussion (Misc queries) 1 June 23rd 05 02:23 PM
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 11:27 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"