footer date plus 3 months

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi I'm trying to add a footer with a note that says "this quotation is valid
until ------)
----- being a date calculated to be three months ahead of todays date. Is
there a way of doing this?
 
ActiveSheet.PageSetup.LeftFooter = _
"This quote is valid until " & Format(DateSerial(Year(Date), Month(Date)
+ 3, Day(Date)), "dd mmmm yyyy")
 
Bob Thanks but I have copied this letter for letter and it is just writing it
out on the footer. It's not actually doing the calculation. How do I make
this work?
 
Maybe it was wrap-around. Try this variation

ActiveSheet.PageSetup.LeftFooter = _
"This quote is valid until " & Format(DateSerial(Year(Date), _
Month(Date) + 3, Day(Date)), "dd mmmm yyyy")
 
Richard said:
Bob Thanks but I have copied this letter for letter and it is just writing
it
out on the footer. It's not actually doing the calculation. How do I make
this work?

Richard, As Bob isn't around at present, try my "newbie" solution!

I inserted Bob's code into my "Sheet1" Tab i.e. Right click Sheet Tab > View
Code > and insert the code into Microsoft Excel Objects > Sheet1 (Sheet1).

Note that you need an extra top and bottom line of code as shown below:

Sub LeftFooter()
ActiveSheet.PageSetup.LeftFooter = _
"This quote is valid until " & Format(DateSerial(Year(Date), _
Month(Date) + 3, Day(Date)), "dd mmmm yyyy")
End Sub

Save and close the code window, then in the main Excel window run the macro
from Tools > Macro > Macros > select "LeftFooter" > Run.

Hopefully one of the experts will be along with the right terminology and
the proper way to do it.
 

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