JohnZ1156
Board Regular
- Joined
- Apr 10, 2021
- Messages
- 180
- Office Version
- 2021
- Platform
- Windows
I'm suddenly getting this error.
Unable to set the RightHeader property of the PageSetup class.
Unable to set the RightHeader property of the PageSetup class.
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.CenterHeader = "&""Arial""&B&I&U&24" & "Bank Check Register" & _
Chr$(10) & "&B&I&U&20" & "Account: XXXX-XXXXXX"
[B]' These 2 lines are yellow.[/B]
Application.ActiveSheet.PageSetup.RightHeader = "&""Arial""&20" & "Page &P of &N " & _
Chr$(10) & Format(ActiveSheet.Range("J1").Value, "$#,##0.00 ")
End Sub