View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Need help with a Macro or VB code for Header/Footer

From VBA help files:

Worksheets("Sheet1").PageSetup.CenterHeader = "&D page &P of &N"

You can also do:

Sub heddft()
Worksheets(1).PageSetup.CenterHeader = "&b &14 My Worksheet" _
& vbCrLf & "Job 1" & vbCrLf & "Some Client" & vbCrLf & "&d"
End Sub

For footer just substitute CenterFooter fow CenterHeader, or LeftHeader,
LeftFooter, etc. It is all the same syntax. The &b and &14 and &d inside
the quote marks set bold = true, Font size = 14 and Current date respectively.
"jgbadingerjr" wrote:

Looking for a macro to enter a custom header and a footer

Header would have:

title of worksheet
job#
client name
date


footer would have:

file path
author
page# of total pages

I saw how to create file paths and dates but I'm trying to combo everything
into an easy to enter series of text boxes so our personnel don't have to
open "page setup" each time...
any suggestions would be appreciated
Thanks

--
jgbadingerjr