+ Reply to Thread
Results 1 to 8 of 8

Simple VBA Header, Changing Font and Size of Text

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Simple VBA Header, Changing Font and Size of Text

    Howdy,
    I have been at this for days and just can not figure it out. I don't ever use VBA so i'm crash coursing it pretty hard.
    I was able to make the header reference two cells, and even put a line break in between the two.
    My next step is to make the first cell Calibri, Bold and 22 font. And the second referenced cell to show up as Calibri, bold, 12 font.

    So basically like this:
    12345
    Plant 2


    I say basically because the size selection is off here i think, but generally this is what i am looking to accomplish.
    Here is the code i am using thus far:
    Please Login or Register  to view this content.
    This code calls the cells properly, but i just can't get the formatting to stick.
    Calculations!B36 needs to be Calibri, Bold, and 22 point font.
    "Plant " and Calculations!B37 need to be Calibri, Bold and 12 point font.
    Oh and it all needs to be right justified, but that is automatic being in the right header pane.

    Any help would be appreciated.
    Thanks in advance :D

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Simple VBA Header, Changing Font and Size of Text

    Here is an example of how you can format a cell. I hope this helps.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-27-2013
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Simple VBA Header, Changing Font and Size of Text

    If i format the cell, will the format carry over to the header where it is being referenced?

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Simple VBA Header, Changing Font and Size of Text

    Sorry but to be honest with you, I'm not sure. Perhaps you could try it out and post back the result.

  5. #5
    Registered User
    Join Date
    06-27-2013
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Simple VBA Header, Changing Font and Size of Text

    Quote Originally Posted by Mumps1 View Post
    Sorry but to be honest with you, I'm not sure. Perhaps you could try it out and post back the result.
    No worries, i had to get back to my office. Changing the format of the original cell it is calling does not affect the formatting of the header.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Simple VBA Header, Changing Font and Size of Text

    Thanks for posting back. Sorry I couldn't be of more help.

  7. #7
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Simple VBA Header, Changing Font and Size of Text

    This should do what you are looking for,

    Please Login or Register  to view this content.
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  8. #8
    Registered User
    Join Date
    06-27-2013
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Simple VBA Header, Changing Font and Size of Text

    BOOM!
    That is what i needed

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1