+ Reply to Thread
Results 1 to 12 of 12

Change Font Type based on Cell Value

  1. #1
    Registered User
    Join Date
    08-25-2014
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    36

    Change Font Type based on Cell Value

    I have a workbook that includes a drop down list with three options. One of the options is "TA". The default font type for these cells is "Wingdings" but when "TA" is chosen I want the Font Type to change to "Arial". Please help.

    Thanks

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Change Font Type based on Cell Value

    Use Conditional Formatting for that cell
    "Format Only Cells that Contain" "Equal to" TA
    Format font appropriately.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-25-2014
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    36

    Re: Change Font Type based on Cell Value

    I tried that previously but when I go to change the Font Type - the Font Type box is greyed out and I cannot select anything in that field.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Change Font Type based on Cell Value

    You're right, it's not allowed. You'll need to use VBA.
    Right click on the sheet tab and "View Code"
    Paste this in, modifying the cell location
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-25-2014
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    36

    Re: Change Font Type based on Cell Value

    Now I went into VBA and I am getting an error message that says "Project is Unviewable". I do not remember doing anythign in VBA that would cause this to happen? Please help.

    It seems as if I cannot record Macros anymore either. I have the file saves as a Macros Enabled Workbook and both VBA and Macros were previously working.
    Last edited by lhickerson; 08-25-2014 at 01:57 PM.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Change Font Type based on Cell Value

    Can you post the workbook? (Go to "Go Advanced" and click on the paper clip)
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  7. #7
    Registered User
    Join Date
    08-25-2014
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    36

    Re: Change Font Type based on Cell Value

    I re-svaed the workbook and VBA and Macros seem to be working now. Maybe something was corrupt with the file.

    OK - back to the original question. I am pretty new to VBA so I am not sure exactly what to do with the Code you wrote above - where do I put this and will it automatically update if "TA" is entered into the cells in that sheet?

    Also, what woud the code be if the range I wanted the font to change for "TA" was P21:P117, R21:R117, T21:T117, V21:V117, X21:X117, Z21:Z117?

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Change Font Type based on Cell Value

    Project unviewable is a typical response if you try to open a project in a Shared workbook. Maybe it's shared either deliberately or inadvertently.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Change Font Type based on Cell Value

    Open your workbook, go to the proper worksheet.
    Right click on the sheet tab and choose "View Code"
    That opens the VBA editor and you should be in the worksheet module.
    Copy and past the below code directly into the large white text box. (If there is no large white text box, let me know)
    Close the VBA editor, no need to save, it will save when you save the workbook.
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-25-2014
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    36

    Re: Change Font Type based on Cell Value

    That worked perfectly - thank you so much. One more question. Is there a way to change the code so that it will always be Arial unless "ü" or "x" is chosen in those same cells? I also always want the font to be unbolded.

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Change Font Type based on Cell Value

    Please Login or Register  to view this content.
    I'm not sure if I got your Bolds in the right place but just move the true/false appropriately.

  12. #12
    Registered User
    Join Date
    08-25-2014
    Location
    New York, New York
    MS-Off Ver
    Excel 2013
    Posts
    36

    Re: Change Font Type based on Cell Value

    You are a rockstar! Thank you so much for all your help. I am sure I will have more posts as I continue to develop this workbook! Many thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to change the font size based on value of the cell?
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2013, 08:59 PM
  2. Mouse rolls over to cell will change the tab color, font color and tp bold type
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-20-2013, 10:36 AM
  3. Change Font Color Based on Another Cell
    By k777 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-22-2010, 08:41 PM
  4. change font color based on cell value
    By herukuncahyono in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-03-2010, 03:34 AM
  5. Change font size based on a Cell Value
    By kalyanverma in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2008, 11:39 AM

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