Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Give multiple charts on a worksheet/workbook same header or footer | Excel Discussion (Misc queries) | |||
Give multiple charts on a worksheet/workbook same header or footer | Charts and Charting in Excel | |||
How do I hide the header and footer on page 1 in Excel? | Excel Discussion (Misc queries) | |||
MACRO FOR SETTING MARGINS WITHOUT OVERRIDING HEADER AND FOOTER | Excel Discussion (Misc queries) | |||
How to insert a picture in the Footer (not the Header) in Excel 20 | Excel Worksheet Functions |