Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dhuang via OfficeKB.com
 
Posts: n/a
Default Header and Footer Macro

Hi!

I created a Macro that inserts the path file, name, and date but I want to
automate the authors name in their too. I remember someone inserting a
msgbox that allowed the author to put in his/her name and it would show in
the footer. As of right now this is what the Macro looks like:

How do I also insert the authors name?

Sub Traveler_Chart()
'
' Traveler_Chart Macro
' Macro recorded 10/31/2005 by David Huang 6-8395
'

'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = "&D"
.LeftFooter = "" & Chr(10) & "&D&T"
.CenterFooter = ""
.RightFooter = "&Z&F"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub
  #2   Report Post  
Dave O
 
Posts: n/a
Default Header and Footer Macro

You'd need to add a few lines of code at the top, something like this:

Dim UserName As String

Do Until UserName < ""
UserName = InputBox("Please enter your name: ", "INPUT REQUIRED")
Loop

and then change one of the footer lines (.LeftFooter, .CenterFooter,
..RightFooter) like this:
..RightFooter = "&Z&F" & " " & UserName

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Give multiple charts on a worksheet/workbook same header or footer Ches Excel Discussion (Misc queries) 8 July 4th 05 09:29 PM
Give multiple charts on a worksheet/workbook same header or footer Ches Charts and Charting in Excel 2 July 4th 05 04:58 PM
How do I hide the header and footer on page 1 in Excel? Performance Technology Excel Discussion (Misc queries) 1 April 14th 05 09:36 PM
MACRO FOR SETTING MARGINS WITHOUT OVERRIDING HEADER AND FOOTER Ro Excel Discussion (Misc queries) 0 March 30th 05 02:31 PM
How to insert a picture in the Footer (not the Header) in Excel 20 jmon Excel Worksheet Functions 2 March 17th 05 05:59 AM


All times are GMT +1. The time now is 08:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"