JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
Have the following code attached to a button in my sheet:
Range("TEDate") has formula: =TEXT(WORKDAY(TODAY(),-1, "DD MMMM YYYY")
Which today would give a value of 12 August 2011, yet after I run the above code, when I click on print preview, the central header shows:
"European Focus: 14 August 2011"
I tried including msgbox CenterHeader after the .CenterHeader line and this gave a message of "European Focus: 12 August 2011" so why is it when I click on print preview it shows 14 August?
Thank you for suggestions in advance,
Jack
Have the following code attached to a button in my sheet:
Code:
Private Sub CommandButton1_Click()
Dim msg As String
msg = "Enter date tracking error is for: (dd mmmm yyyy):"
With ActiveSheet.PageSetup
.CenterHeader = "European Focus: " & InputBox(msg, "Date of Tracking Error", Range("TEDate"))
.LeftFooter = "Path: " & ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
End With
End Sub
Range("TEDate") has formula: =TEXT(WORKDAY(TODAY(),-1, "DD MMMM YYYY")
Which today would give a value of 12 August 2011, yet after I run the above code, when I click on print preview, the central header shows:
"European Focus: 14 August 2011"
I tried including msgbox CenterHeader after the .CenterHeader line and this gave a message of "European Focus: 12 August 2011" so why is it when I click on print preview it shows 14 August?
Thank you for suggestions in advance,
Jack