Forum Discussion
rickrpr
Aug 03, 2020Copper Contributor
Simple macro Excel 2010
Hello. I'm trying to execute a simple macro to print information on the footer of actice sheet using Excel 2010. When I record a macro personalizing the footer: Left footer -> Page: &[Pag...
NikolinoDE
Aug 03, 2020Platinum Contributor
Do it yourself quickly with VBA header and footer. Simply in one module and adjust as needed.
Option Explicit
Sub Set_Print_Header_footer ()
With ActiveSheet.PageSetup
'.PrintArea = "A1:F60" 'Area 1
'.PrintArea = "CS1:DG60" 'Area 2
ActiveSheet.PageSetup.PrintArea = "G1:U60"
ActiveSheet.PageSetup.CenterHeader = "&""Arial,Fett""" & "&14" & "BEST_Sheet_Header" & " - " & Format(Range("E4").Value, "mmmm yyyy ")
ActiveSheet.PageSetup.LeftHeader = "&""Arial,Fett""" & "&14" & "My Company" & Chr(10) & Range("A3") & Chr(10) & Range("F4")
ActiveSheet.PageSetup.LeftFooter = "&""Arial,Fett""" & "&10" & "Call me..my phone is…"
'etc......
End With
Application.CommandBars.ExecuteMso "PrintPreviewAndPrint"
End Sub
If you find this helpful, please mark it as "Best Answer" and as Like (click thumbs up), it will be beneficial to more Community members reading here.
Nikolino
I know I don't know anything (Socrates)