+ Reply to Thread
Results 1 to 5 of 5

Changing font type in a macro

  1. #1
    Registered User
    Join Date
    11-02-2011
    Location
    Midwest, US
    MS-Off Ver
    Excel 2010
    Posts
    43

    Changing font type in a macro

    Found a couple of threads but did not seem to find what I was looking for. It's been a while since I played with Macros ans I was used to 2003 and now I'm using 2010. On a simple Macro like I provided I want to change the font. Thought that I would just type in the .name = "Calibri" section and change the font to Time New Roman for example .name="Times New Roman". The other formatting takes place in the sheet when I run the Macro, but the font still stays as Calibri, what am I doing wrong?

    Please Login or Register  to view this content.
    Last edited by dotsofcolor; 12-06-2011 at 12:28 AM. Reason: Put in code tags

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Changing font type in a macro

    In your code you have the font name as calibri, try changing that line and all should be good.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Registered User
    Join Date
    11-02-2011
    Location
    Midwest, US
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Changing font type in a macro

    Tried that but it did not seem to work. I would think that I wouldn't have to close the VBE to get it to work. I did some other changes like the size, etc. and they took effect. Any thoughts on why the font is not changing?

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Changing font type in a macro

    Try this:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  5. #5
    Registered User
    Join Date
    11-02-2011
    Location
    Midwest, US
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Changing font type in a macro

    I was finally able to get my original macro to work but your code was cleaner Domski and worked great. Thank you for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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