+ Reply to Thread
Results 1 to 7 of 7

Macro to increase font size

  1. #1
    Registered User
    Join Date
    09-23-2009
    Location
    Cornwall, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Macro to increase font size

    Hi, I am looking for a macro that will increase the font size in the selected cell/range by 1 point. For example; with cell A1 selected and a default font size of 11, if i ran the macro 4 times (on the same selection) the font size in the selected cell would then be 15. I can only seem to manage to set the font size to a fixed size and this is not what i am looking for. It seems like a simple problem but i cannot find a way to do it (i'm a bit of a VB idiot though!). Any help would be greatly appreciated. Cheers!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Re: Macro to increase font size

    Hi,

    How about this:

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to increase font size

    Welcome to the forum.

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Re: Macro to increase font size

    SHG,

    Why the (1) ?

  5. #5
    Registered User
    Join Date
    09-23-2009
    Location
    Cornwall, England
    MS-Off Ver
    Excel 2002
    Posts
    6

    Re: Macro to increase font size

    Thank you all. I feel truly stupid now - i knew it should be simple.

    Cheers!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro to increase font size

    SHG,

    Why the (1) ?
    If the selection contains multiple cells, and the font size is not all the same, Selection.Font returns Null. This way it applies a font size one point larger than the first cell in the selection.

  7. #7
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,443

    Re: Macro to increase font size

    Gotcha! Thank you.

+ 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