View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Formatted Date in header applied with a macro

You can't format the date when it is in the header. =NOW() and any formula
doesn't work with a header. The 3rd method I have two statements. The
second statement Range("A1").NumberFormat = "mm/dd/yy" formats the cell as
if you manually formatted the cell using the menu Format - Cell - Number and
chose one of the date formats.


"Kay" wrote:

Joel,

thanks so much for taking the time to explain the different techniques. I
recorded the macro first using the date button, but then changed the code to
use the format(date, mmmm dd, yyyy). I was just surprised that it would not
update, the same as a regular header that uses the date button option. Can I
assume that if I used your third method Range("A1").Formula = "=Now()" that
while it would update, you might not be able to get it to format as above? I
am ever so grateful for the explanations and it is very important to me that
I understand why.

Thanks again!

"Kay" wrote:

Hello all,

I was just looking at the post for formatting the date in a header. My
question concerns how to get the date to update without re-running the macro.
If you use the default date as added via the header footer toolbar, it
updates fine, but format(date, mmmm dd, yyyy) does not.