Programing a footer

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

I am a numbers guy and not a programmer so bear with me.

I have the following macro

Sub Craig()

Dim Footer As String

Section = InputBox("Enter SECTION Number:")
With ActiveSheet.PageSetup
.CenterFooter = "&""Arial,Bold""&14" & Section
End With
End Sub

This is works and puts the section number in the center footer, but I would
like to have excel inset the page number in after the section number I
input. I have tried using &P after the & Section, but that doesn't work.
What am I doing wrong? Thanks for the help!
 
You have to remember to add the &P in quotes: "&P"

ActiveSheet.PageSetup.CenterFooter = "&""Arial,Bold""&14" & Section & "-&P"

Will yield, e.g., 6-1
 
Thank You


Eric White said:
You have to remember to add the &P in quotes: "&P"

ActiveSheet.PageSetup.CenterFooter = "&""Arial,Bold""&14" & Section &
"-&P"

Will yield, e.g., 6-1
 
Back
Top