ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I set a date formula in the page setup header to add 10 (https://www.excelbanter.com/excel-discussion-misc-queries/94145-how-do-i-set-date-formula-page-setup-header-add-10-a.html)

phil@work

How do I set a date formula in the page setup header to add 10
 
Need to display todays date plus 10 in the page setup header.

CLR

How do I set a date formula in the page setup header to add 10
 
This macro should do it.........

Sub DatePlus10ToHeader()
With ActiveSheet.PageSetup
.LeftHeader = Month(Date) & "/" & Day(Date) + 10 & "/" & Year(Date)
End With
End Sub


Vaya con Dios,
Chuck, CABGx3




"phil@work" wrote:

Need to display todays date plus 10 in the page setup header.


Dave Peterson

How do I set a date formula in the page setup header to add 10
 
I think I'd use:

Sub DatePlus10ToHeader()
With ActiveSheet.PageSetup
.LeftHeader = format(date+10,"mm/dd/yyyy")
End With
End Sub

When you concatenated the string, day(date)+10 might not be the day you want.

CLR wrote:

This macro should do it.........

Sub DatePlus10ToHeader()
With ActiveSheet.PageSetup
.LeftHeader = Month(Date) & "/" & Day(Date) + 10 & "/" & Year(Date)
End With
End Sub

Vaya con Dios,
Chuck, CABGx3

"phil@work" wrote:

Need to display todays date plus 10 in the page setup header.


--

Dave Peterson

CLR

How do I set a date formula in the page setup header to add 10
 
Agreed Dave.......thanks for making the point.

Vaya con Dios,
Chuck, CABGx3



"Dave Peterson" wrote:

I think I'd use:

Sub DatePlus10ToHeader()
With ActiveSheet.PageSetup
.LeftHeader = format(date+10,"mm/dd/yyyy")
End With
End Sub

When you concatenated the string, day(date)+10 might not be the day you want.

CLR wrote:

This macro should do it.........

Sub DatePlus10ToHeader()
With ActiveSheet.PageSetup
.LeftHeader = Month(Date) & "/" & Day(Date) + 10 & "/" & Year(Date)
End With
End Sub

Vaya con Dios,
Chuck, CABGx3

"phil@work" wrote:

Need to display todays date plus 10 in the page setup header.


--

Dave Peterson



All times are GMT +1. The time now is 03:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com