Date Posting

J

Jim May

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
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top