As of date formula in a footer

B

Belinda7237

I am trying to figure out how to insert a formula in a footer so that when
the page is printed the current date and time will appear but i also want to
include an as of date. My as of date will always be the monday prior to the
print date.

Is this possible?
 
B

Bernie Deitrick

Belinda,

If you put the date and time in the right side of the footer, then you can use code to update the
left side with your As of:

ActiveSheet.PageSetup.LeftFooter = "As of " & Format(Date - Weekday(Date, 2) + 1, "mmmm d, yyyy")

HTH,
Bernie
MS Excel MVP
 
B

Belinda7237

thanks, but I have one more question - when i am in page setup and insert
that into the footer it comes out as is - how do i insert code into the
footer? (sorry a first for me)
 
B

Bernie Deitrick

Belinda,

You cannot insert code into the footer - the best you can do is use the code
I posted in a macro, or in the beforeprint event.

Bernie
 

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