+ Reply to Thread
Results 1 to 10 of 10

find cell with different font

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Cheyenne, WY
    MS-Off Ver
    Excel 2007
    Posts
    6

    Smile find cell with different font

    Problem: I need to find cells that do not have either the Arial or Symbol fonts (as our printer driver on the server does not like any other font). This can work for the whole workbook or per Sheet, either way.
    Then I will manually change the fonts.
    Alternatively we could change the font that is not "arial or Symbol", to Arial, directly! :o)

    Suggestion: I am thinking of having a routine that searches through the cells and changes the color of the font (to orange) on those cells that contain a different font than Arial and Symbol.

    I have basic knowledge of how to use VBA.

    Thank you very much for the help!

    Benoit

  2. #2
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: find cell with different font

    This file will help you out....
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    Cheyenne, WY
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: find cell with different font

    Thank you very much! The routine works but only if the font that is not arial or symbol is in column A; how to modify the routine so it looks in every column?

    Benoit

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: find cell with different font

    Another:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-29-2013
    Location
    Cheyenne, WY
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: find cell with different font

    Thank you John, that works almost perfectly! The cells that have symbols in them also turned to Arial... something is odd because the code made sense... do you have an idea.

    Also I have cells in my spreadsheet that have multiple fonts; hopefully the routine will not change the whole cell to a single font... we'll see!

    :o)

  6. #6
    Registered User
    Join Date
    04-29-2013
    Location
    Cheyenne, WY
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: find cell with different font

    I changed the "or" to "and" and now it works!

    Thank you very much!!!

    Benoît

    Final code:

    Sub bcordoba()
    Dim rcell As Range
    Dim ws As Worksheet

    Application.ScreenUpdating = False

    For Each ws In ActiveWorkbook.Worksheets

    ws.Activate

    For Each rcell In ws.UsedRange

    If rcell.Font.Name <> "Arial" and rcell.Font.Name <> "Symbol" Then

    rcell.Font.Name = "Arial"

    End If

    Next rcell

    Next ws

    Application.ScreenUpdating = True
    End Sub

  7. #7
    Registered User
    Join Date
    04-29-2013
    Location
    Cheyenne, WY
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: find cell with different font

    John,

    Again thank you.

    The code works for changing the entire cell to a font; is there a way to change the portion of the content of a cell that are not font Arial or Symbol? I mix fonts in some cells and they do not change the words in non-arial-or-symbol if there are some words in arial or symbol fonts in those cells.

    Benoit

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: find cell with different font

    You're are welcome. The code seems to work for cells which have entire cells with one font and skips over the mixed code. If you need it to deal with Arial and Symbol letters in a mixed font cell, I'm afraid I can't help you their. I wouldn't know where to begin.

  9. #9
    Registered User
    Join Date
    04-29-2013
    Location
    Cheyenne, WY
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: find cell with different font

    Thank you John. Mixed font cells are easier to spot so I will check them. I really, really appreciate your help with this problem.



    Benoît
    Last edited by bcordoba; 04-30-2013 at 01:47 PM.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: find cell with different font

    Again welcome. Glad to help out. Not sure if anyone else can help you with the mixed font cells. But if you consider this thread solved please adhere too Forum Rule No. 9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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