#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Date Posting

In a new WB - Book1 - in the immediate window I type in:

x = now
? x
11/18/2007 10:25:29 AM

x =Format(x,"mmmm dd, yyyy")
? x
November 18, 2007

Range("A1") = x
===================================
Why does A1 display 18-Nov-07 (formula bar = 11/18/2007) ??

TIA,

Jim


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Date Posting

If you want to treat that cell like text, you could use:

Range("A1") = "'" & Format(date,"mmmm dd, yyyy")
or
with range("a1")
.numberformat = "@" 'text
.value = Format(Date,"mmmm dd, yyyy")
end with

if you want to treat that cell as a date:
with range("a1")
.numberformat = "mmmm dd, yyyy"
.value = date
end with


Jim May wrote:

In a new WB - Book1 - in the immediate window I type in:

x = now
? x
11/18/2007 10:25:29 AM

x =Format(x,"mmmm dd, yyyy")
? x
November 18, 2007

Range("A1") = x
===================================
Why does A1 display 18-Nov-07 (formula bar = 11/18/2007) ??

TIA,

Jim


--

Dave Peterson
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
Posting problems...again! T. Valko Excel Discussion (Misc queries) 2 August 20th 07 01:28 PM
[OT] posting tomek gomek Excel Worksheet Functions 24 July 28th 07 03:16 AM
Posting date Dennis Excel Worksheet Functions 1 January 12th 06 04:15 AM
the owner of posting should be able to delete the posting Mahendra Excel Discussion (Misc queries) 7 August 8th 05 07:21 PM
Posting in the next row Greg Excel Worksheet Functions 1 January 18th 05 08:57 PM


All times are GMT +1. The time now is 05:22 PM.

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

About Us

"It's about Microsoft Excel"