Programing a footer

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!
 
G

Guest

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
 
C

Craig

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top