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

using formula in Header/Footer 1

Status
Not open for further replies.

Johnomill

Technical User
Dec 19, 2001
19
NL
Hi,

I would like to modify the footer of my page before printing it with the name of my company-unitname. But the code interprets everything as string. Is there another sollution to this problem?

Unitname=Worksheets(n).Cells(r,k)
With ActiveSheet.PageSetup
.LeftFooter = "&""Arial,Regular,UnitName"
End With
etc...

Best regards,

John
 
assuming UnitName is a string variable,

Code:
.LeftFooter = "&""Arial,Regular""" & UnitName

 
Hi Justin,

I tried this one and it returns "False" as result in my footer. I declared UnitName as a stringvariable.

John
 
John,

The following works. It only requires that you assign the range name "uname" to the cell in your workbook that contains the unit name.

Sub Set_Footer()
unitname = Range("uname").Value
ftr = "CompanyName_" & Str(unitname)
With ActiveSheet.PageSetup
.LeftFooter = "&""Arial,Regular," & ftr
End With
End Sub

Hope this helps. :)

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top