A
Android
I'm using the following code to automatically add headers and footers for
all the sheets in my workbooks.
Although it works, it is extraordinarily slow -- 2-3 minutes.
Can anyone suggest a way to do this faster. I am using Office XP, under
Windows 2000 Pro operating system.
The code I am using is:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim sCount, i As Integer
sCount = Worksheets.Count
For i = 1 To sCount
With Worksheets(i).PageSetup
.LeftHeader = "&""Arial""&8" & "Worksheet: &A"
.LeftFooter = "&""Arial""&8" & ThisWorkbook.FullName & Chr(10) &
" " & Chr(10) & " "
.CenterFooter = "&""Arial""&8" & "Page &P of &N"
.RightFooter = "&""Arial""&8" & "Print Date: &D"
End With
Next i
End Sub
all the sheets in my workbooks.
Although it works, it is extraordinarily slow -- 2-3 minutes.
Can anyone suggest a way to do this faster. I am using Office XP, under
Windows 2000 Pro operating system.
The code I am using is:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim sCount, i As Integer
sCount = Worksheets.Count
For i = 1 To sCount
With Worksheets(i).PageSetup
.LeftHeader = "&""Arial""&8" & "Worksheet: &A"
.LeftFooter = "&""Arial""&8" & ThisWorkbook.FullName & Chr(10) &
" " & Chr(10) & " "
.CenterFooter = "&""Arial""&8" & "Page &P of &N"
.RightFooter = "&""Arial""&8" & "Print Date: &D"
End With
Next i
End Sub