#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Date Format

I am writing a macro to save the name in cell A1 and I have a date Value in
cell B5

I am wanting excel to suggest for example greg 15 june 2005

here is the code so far but it wont save because it is coming up 16/6/2005

Suggestion = Range("A1").Value & Range("B5")

Thank in advance

Greg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Date Format

Suggestion = Range("A1").Value _
& lcase(format(Range("B5").value,"dd mmmm yyyy"))

Greg Brow wrote:

I am writing a macro to save the name in cell A1 and I have a date Value in
cell B5

I am wanting excel to suggest for example greg 15 june 2005

here is the code so far but it wont save because it is coming up 16/6/2005

Suggestion = Range("A1").Value & Range("B5")

Thank in advance

Greg


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Date Format

thanks worked a charm

Greg


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Date Format

Just some added info:
If the cells look as you want, you could simplify that to

Range("Whatever").Value = Range("A1").Text & " " & Range("B5").Text
or
Range("Whatever").Value = Trim(Range("A1").Text) & " " & _
Trim(Range("B5").Text)


Text displays as the cell displays
Value displays what is actually stored in the cell.

If you want Dave's solution to return what you stated, you might want to add

Suggestion = trim(Range("A1").Value) & " " & _
& lcase(format(Range("B5").value,"dd mmmm yyyy"))

--
Regards,
Tom Ogilvy


"Greg Brow" wrote in message
...
thanks worked a charm

Greg




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Date Format

Thanks will try them all to see what works the best

Greg
"Tom Ogilvy" wrote in message
...
Just some added info:
If the cells look as you want, you could simplify that to

Range("Whatever").Value = Range("A1").Text & " " & Range("B5").Text
or
Range("Whatever").Value = Trim(Range("A1").Text) & " " & _
Trim(Range("B5").Text)


Text displays as the cell displays
Value displays what is actually stored in the cell.

If you want Dave's solution to return what you stated, you might want to
add

Suggestion = trim(Range("A1").Value) & " " & _
& lcase(format(Range("B5").value,"dd mmmm yyyy"))

--
Regards,
Tom Ogilvy


"Greg Brow" wrote in message
...
thanks worked a charm

Greg






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
permanent conversion of 1904 date format to 1900 date format Jos Excel Worksheet Functions 4 November 26th 15 02:48 PM
change date format dd/mm/yyyy to Julian date format? itzy bitzy Excel Worksheet Functions 1 December 8th 09 07:42 PM
Excel 2000 date format cannot be set to Australian date format Brian Jones Excel Discussion (Misc queries) 1 March 30th 05 06:03 AM
code to convert date from TEXT format (03-02) to DATE format (200203) Gauthier[_2_] Excel Programming 0 September 22nd 04 03:26 PM
Change a date in text format xx.xx.20xx to a recognised date format concatenator Excel Programming 1 November 24th 03 11:33 PM


All times are GMT +1. The time now is 09:43 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"