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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Assign a variable value to an Excel 2003 Header? 1

Status
Not open for further replies.

Evil8

MIS
Mar 3, 2006
313
US
In excel 2003 I have a worksheet center header:

Company Name
Group Health Renewal
Effective Date

I want to take the value of 2 input boxes (run from a macro) to change Company Name and Effective Date in the header but I don't know how to assign the values.

I have the inputs and variables declared:

Dim cName As String
Dim eDate As String
cName = InputBox("Type in Company Name", "Company Name")
eDate = InputBox("Type in Effective Date", "Effective Date")

With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = _
"&""Arial,Bold""&Company Name" & Chr(10) & "Group Health Renewal" & Chr(10) & "Effective Date"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""

...

Thank you for your help.
 
Perhaps this ?
.CenterHeader = _
"&""Arial,Bold""& " & cName & Chr(10) & "Group Health Renewal" & Chr(10) & eDate


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top