Hi All, the workbook I'm working on has some code that automatically sets the footer, namely:
However, there is one worksheet that is longer than one page, therefore the text will show "page 11 of 10". If I set the page height to one page high, then the text is too small. Is there something that can be done to correct this?
Code:
Sub Calc_Footer()
Dim ws As Worksheet
Dim dt As String, SN As String, ft As String
dt = Format(Sheets("General Data").Range("D4"), "dd-mmm-yy")
SN = Sheets("General Data").Range("B11")
ft = "FLM SN" & SN & " " & dt
I = 0
For Each ws In ActiveWorkbook.Worksheets
If ws.Visible = True Then
I = I + 1
End If
Next
Sheets("Release").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("Summary").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("General Data").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("Slow Scan").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("Laser Power").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("Focus Depth").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("OCT").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("cCornea").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("cCat").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("Misc").PageSetup.RightFooter = ft & " " & "Page &P of " & I
Sheets("PM").PageSetup.RightFooter = ft & " " & "Page &P of " & I
End Sub