• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1755
  • Last Modified:

Excel VBA Header Footer Control codes

Hello,
I'm trying to programmatically insert header and footer information in Excel.  If I have the following input variables identified, what would be the correct syntex to use?
myFont, myFontSize, myHeaderFooterText

I've tried the following and it did not work.
    BuildString = Chr(34) & "&" & Chr(34) & Chr(34) & myFont & " Chr(34) & Chr(34) & "&"_    
                          & myFontSize & myHeaderFooterText & Chr(34)
    wksht.PageSetup.RightFooter = BuildString

Can someone help?
0
COPUSER
Asked:
COPUSER
  • 2
  • 2
1 Solution
 
Patrick MatthewsCommented:
   BuildString = "&""" & myFont & ",Regular""&" & myFontSize & _
        myHeaderFooterText
    wksht.PageSetup.RightFooter = BuildString

0
 
COPUSERAuthor Commented:
Thanks, matthewspatrick.  It worked.  I have another proposition.  I need to do somthing similar to other Microsoft Office apps: Word, Powerpoint, and Visio.  For additional 250 points, can you provide me additional code examples?  Much appreciated.
0
 
Patrick MatthewsCommented:
I have no idea for Powerpoint or Visio.  For Word, it is complicated in that each document
section has its own header/footer.
0
 
COPUSERAuthor Commented:
Thanks, matthewspatrick.  I'll keep digging.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now