+ Reply to Thread
Results 1 to 5 of 5

vba Find specific text font and change color

  1. #1
    Registered User
    Join Date
    01-14-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    5

    vba Find specific text font and change color

    Hi everyone
    I am just started learning about VBA, but I need a little help, here in the beginning.

    I need help for a code, that can find data for me in the excel ark.
    The code need to do the following.
    • Find all the cells in column “D” that contains text with the text font “Calibri “
    Then color the cell in column “G” and in the same row.

    For more information see the picture.

    Thank you for your time

    14-01-2014 22-39-58.png

  2. #2
    Registered User
    Join Date
    06-09-2011
    Location
    Newcastle, Australia
    MS-Off Ver
    2003, 2010
    Posts
    54

    Re: vba Find specific text font and change color

    Hi jacgeld welcome to the forum

    Not knowing your level of experience
    A few questions before we get started...
    1. How do you propose to run this macro.
      • From the "Macros" dialog
      • a control (button) on the worksheet (dedicated to the workbook containing your macro
      • shortcut-keys dedicated to the workbook/worksheet
      • an addin to use the macro with any open workbook, with the same columns structure ?
    2. Will the columns always be "D" and "G" ?
    3. Do you want the macro to only evaluate selected cells in column("D") or to process all data cells in Column("D")
      Do you want to process the column header cell
    4. What version of Excel are you using 2007/2010 or later?

    Regards
    GreyGhost
    Last edited by GreyGhost; 01-14-2014 at 06:07 PM. Reason: corrections

  3. #3
    Registered User
    Join Date
    01-14-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: vba Find specific text font and change color

    HI GreyGhost

    Thank you for your fast reply.
    1: From the dialog would be perfect
    2: The Columns we always be D and G
    3: The Macros have to process all data in Column D ex. From D1 to D2000
    4: I am using Excel 2010

    As you properly have figured out, I am new ad VBA.
    My plan is to get started with this code and the build on to it.
    If you need more information, just ask me again.
    Thank you for your help.

  4. #4
    Registered User
    Join Date
    01-14-2014
    Location
    Denmark
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: vba Find specific text font and change color

    Hi GreyGhost

    Hope you can survive the heat

    I have found a solution.
    Mayby not the smartest code, but it works.
    Please Login or Register  to view this content.
    Thank you for your time.
    Last edited by vlady; 01-17-2014 at 10:25 PM. Reason: code tags

  5. #5
    Registered User
    Join Date
    06-09-2011
    Location
    Newcastle, Australia
    MS-Off Ver
    2003, 2010
    Posts
    54

    Re: Solution:- vba Find specific text font and change color

    jacgeld

    This code is more versatile...
    • Column numbers are constants in the macro, so you can easily change the two fields in the future
    • Font name and Size are Constants, easily changed if required
    • Does not use "Selection" method/object -- process time is monumentally faster.
      Selecting each cell in a loop is not efficient
    • Clears cell fill-color from any cells in Column- "G" that do not meet the criteria.
      Only cells that do meet the criteria are colored
    • Uses "UsedRange" rather than terminating at first empty cell, else some cells could be be missed
    • Is designed to work with an island of cells, not necessarily cells starting in row(1)
    • Screenupdating, is manipulated to speeden up process time, monumentally faster on large lists
    • Any errors are trapped and a msg shown, outlining the error number + its description, avoiding user shock if an error occurs.

    Please Login or Register  to view this content.

+ 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. Replies: 28
    Last Post: 08-29-2013, 02:53 PM
  2. Change font color of specific text as a result of an if statement
    By Triscia in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-07-2013, 11:47 AM
  3. Find a word and change font color
    By bbqmikeq in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-28-2012, 12:43 PM
  4. How to find text in cell and change font color if found
    By niraya in forum Excel - New Users/Basics
    Replies: 19
    Last Post: 05-14-2012, 01:23 PM
  5. Change font color of Find text
    By Shea603 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2012, 11:24 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