I recorded a macro but it did not show it when print preview or when
printing.
To explane the idea more:
If I go to the page setup menu, header & Footer and add the custom
header i want, it stays there and can be seen when printing it.
Can these steps be done using VBA code?
The following should do the trick:
Sub Add_Header_Footer()
With ActiveSheet.PageSetup
.LeftHeader = "My Left Header"
.CenterHeader = "My Center Header"
.RightHeader = "My Right Header"
.LeftFooter = "My Left Header"
.CenterFooter = "My Center Footer"
.RightFooter = "My Right Footer"
End With
End Sub
dave y.