Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompt me to input a page header

Status
Not open for further replies.

cboz

Technical User
Dec 24, 2002
42
US
In Excel, I have a macro that formats all of my PageSetup stuff. I would like for the macro to prompt me to input a title in the .CenterHeader. Is this possible? Here is the code for the macro as it is now.

Sub PageSetupLandscape()
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$1"
.LeftHeader = "&G"
ActiveSheet.PageSetup.LeftHeaderPicture.Filename = _
"C:\Documents and Settings\Me\My Documents\My Pictures\MyPicture.jpg"
With ActiveSheet.PageSetup.LeftHeaderPicture
.Height = 27.75
.Width = 93.75
End With
.RightHeader = "&D"
.CenterHeader = "&""-,Bold""&16Enter Title"
.RightFooter = "Page &P of &N"
.CenterFooter = ""
.LeftFooter = ActiveWorkbook.FullName
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintGridlines = True
.PrintHeadings = True
.CenterHorizontally = True
.Orientation = xlLandscape

End With
 
.CenterHeader = "&""-,Bold""&16" & InputBox("Enter Title")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks. You just saved me hours of trial and error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top