Inserting day with date automatically - how?

  • Thread starter Thread starter DrB
  • Start date Start date
D

DrB

Have "date" in header updating automatically in Excel 2002 (XP). How can I
also have the "day" inserted there and updated automatically?
 
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = Format(Date, "ddd dd mmm yyyy")
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
I copied the following:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = Format(Date, "ddd dd mmm yyyy")
End With
End Sub

and pasted into a new workbook code obtain from viewing code in the file
that I wanted this option, but nothing happened. Went into viewing
Header/Footer and found nothing new there. Is there another step?
 
It won't be in header/footer, it happens when you print. So a print preview.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
I changed the security level to medium and closed. Reopened with it asking
me if I wanted to macro which I answered "yes". Went to print preview and it
still showed the date but not the day. What am I missing?
 
Sorry I was looking at the right margin rather than the left. Yes it works
so I changed it to the right margin. Thank you very much.
 

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

Back
Top