Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 16th, 2003, 03:24 AM
Registered User
Join Date: Nov 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel Header Font

how can i access the header font and size in header section of my excel via Visual basic?

Reply With Quote
  #2 (permalink)  
Old December 16th, 2003, 05:25 AM
Authorized User
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts

You can set the font name/size by setting a string value such as

 &"Arial"&8 My Header

ActiveWorkbook.Worksheets(1).PageSetup.LeftHeader = "&""Arial""&8 My Header"

this sets the left-hand header to "My Header" in Arial 8 point
Reply With Quote
  #3 (permalink)  
Old March 26th, 2007, 09:53 PM
Registered User
Join Date: Mar 2007
Location: Portland, Oregon, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

this was helpful...

However, how do you implement a string variable?

the following is a snippet from a macro I wrote:

Application.Worksheets("sheet1").PageSetup.LeftHeader = _
        "&""Arial,bold""&15""&  " & Worksheets("sheet2").Range("A1").Value

this seems to work (correct font and size) except that whatever the ("A1").value is it will print that preceded by a quotation mark (ie... "myvalue )

I have tried various combos within the syntax, but this is as close as I can get. I should note that the value mentioned is a number, just in case that may mean something.

any suggestions?
any help is greatly appreicated.

Reply With Quote
  #4 (permalink)  
Old March 28th, 2007, 03:15 PM
Registered User
Join Date: Mar 2007
Location: Portland, Oregon, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

found the solution:



Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Grid Column Header font problem suji VB.NET 0 June 12th, 2008 07:48 AM
set font for grid column header suji Visual Studio 2005 0 June 12th, 2008 07:40 AM
Font size of Header Text in DetailsView Control AspNetGuy ASP.NET 3.5 Basics 3 May 22nd, 2008 04:23 PM
Page Breaks and Font Style in Excel shagaset Classic ASP Professional 2 December 14th, 2004 10:30 AM

All times are GMT -4. The time now is 05:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.