JohnZ1156
Board Regular
- Joined
- Apr 10, 2021
- Messages
- 179
- Office Version
- 2021
- Platform
- Windows
I have a check register file. My header use to look something like this:
Now it looks like this:
I'm only talking about the Font sizes, bold and underline for the Left and the Center headers. Ignore the values.
I read online to update my printer drivers, but if I open an older version of the file, it works, but the newer version doesn't work.
I have NO idea what changed and why the header is suddenly not working.
Here is my macro which has not changed between the 2 files..
The GREEN lines are trial and error attempts.
Now it looks like this:
I'm only talking about the Font sizes, bold and underline for the Left and the Center headers. Ignore the values.
I read online to update my printer drivers, but if I open an older version of the file, it works, but the newer version doesn't work.
I have NO idea what changed and why the header is suddenly not working.
Here is my macro which has not changed between the 2 files..
The GREEN lines are trial and error attempts.
VBA Code:
Sub RegisterHeader()
' Format Data in Header
Application.ActiveSheet.PageSetup.LeftHeader = ""
Application.ActiveSheet.PageSetup.CenterHeader = ""
Application.ActiveSheet.PageSetup.RightHeader = ""
Application.ActiveSheet.PageSetup.LeftFooter = ""
Application.ActiveSheet.PageSetup.CenterFooter = ""
Application.ActiveSheet.PageSetup.RightFooter = ""
Application.ActiveSheet.PageSetup.BottomMargin = Application.InchesToPoints(0.5)
Application.ActiveSheet.PageSetup.TopMargin = Application.InchesToPoints(1)
Application.ActiveSheet.PageSetup.LeftHeader = "&""Arial""&20" & "Printed on " & Format(Date, "m/d/yyyy") & " at " & Format(Time, "h:mm AM/PM") & _
Chr$(10) & "&16" & "Closing: " & Format(ActiveSheet.Range("H9").Value, "$#,##0.00 ") & "Cleared: " & Format(ActiveSheet.Range("H11").Value, "$#,##0.00 ") & _
Chr$(10) & "&14" & "W: " & Format(ActiveSheet.Range("D6").Value, "$#,##0.00 ") & "D: " & Format(ActiveSheet.Range("E6").Value, "$#,##0.00")
' Application.ActiveSheet.PageSetup.LeftHeader = "&""Arial""&20" & "Printed on " & Format(Date, "m/d/yyyy") & " at " & Format(Time, "h:mm AM/PM") & _
Chr$(10) & "&12" & "Closing: " & Format(ActiveSheet.Range("H9").Value, "$#,##0.00 ") & _
Chr$(10) & "&12" & "With: " & Format(ActiveSheet.Range("D6").Value, "$#,##0.00 ") & "Dep: " & Format(ActiveSheet.Range("E6").Value, "$#,##0.00 ") & "Net: " & Format(ActiveSheet.Range("H6").Value, "$#,##0.00 ")
Application.ActiveSheet.PageSetup.CenterHeader = "&""Arial""&B&I&U&24" & "Bank Check Register" & _
Chr$(10) & "&B&I&U&20" & "Account: 1234-56789"
' Application.ActiveSheet.PageSetup.RightHeader = "&""Arial""&20" & Format(ActiveSheet.Range("J1").Value, "$#,##0.00 ") & " Page &P of &N "
Application.ActiveSheet.PageSetup.RightHeader = "&""Arial""&20" & "Page &P of &N " & _
Chr$(10) & Format(ActiveSheet.Range("J1").Value, "$#,##0.00 ")
' Application.ActiveSheet.PageSetup.RightHeader = "&""Arial""&12" & _
"Grand Total = " & Format(ActiveSheet.Range("C28").Value, "$#,##0.00 ")
' Application.ActiveSheet.PageSetup.LeftFooter = "&""Arial""&16" & "Withdrawals Total: " & Format(ActiveSheet.Range("D6").Value, "- $#,##0.00 ") & "Deposits Total: " & Format(ActiveSheet.Range("E6").Value, "$#,##0.00 ")
End Sub