+ Reply to Thread
Results 1 to 4 of 4

How to change color of one word of Text in a cell

  1. #1
    Registered User
    Join Date
    12-01-2022
    Location
    India
    MS-Off Ver
    2019
    Posts
    36

    How to change color of one word of Text in a cell

    Sir,

    I have a paragraph in one cell and have to change color of the Text " Ben " to red color, wherever the word Ben showing. Only change the color of word Ben.

    I tried using conditional formattting " specific text" and find and replace function, but entire cell highlighted with red color.

    Excel sheet attached

    Support will be highly appreciated.



    Thanks in advance
    Attached Files Attached Files
    Last edited by 6StringJazzer; 10-02-2023 at 11:19 AM. Reason: clarified title

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,819

    Re: How to change color of a Text in a cell

    You won't be able to use Conditional Formatting to do that, as it works on the contents of the whole cell. You will need VBA to do what you want.

    Ask a Moderator to move your thread into the VBA forum.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-01-2022
    Location
    India
    MS-Off Ver
    2019
    Posts
    36

    Re: How to change color of a Text in a cell

    Noted, thanks for your clarification.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hello, try this !


    According to your attachment a VBA demonstration for starters :

    PHP Code: 
    Sub Demo1()
      Const 
    "Ben"
        
    Dim L&, Rc As RangeP&
            
    Len(S)
        For 
    Each Rc In ActiveSheet.UsedRange.SpecialCells(22)
            
    InStr(RcS)
      While 
    P
            Rc
    .Characters(PL).Font.Color vbRed
            P 
    InStr(3RcS)
      
    Wend
        Next
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

+ 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. change background textbox color based on text color in cell
    By atadaliran in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2021, 05:34 AM
  2. Need vba code to color cells and change color if not equal as text from cell
    By FvdF in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2020, 08:45 AM
  3. [SOLVED] Change text color of selected cells based on a text value of another cell
    By JNEWBURY2280 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-09-2014, 11:26 PM
  4. Macro to change cell text color based on darkness of cell fill color
    By cincyshirm61 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2014, 12:11 PM
  5. Replies: 0
    Last Post: 03-12-2013, 04:29 PM
  6. Replies: 0
    Last Post: 09-26-2012, 01:08 PM
  7. change text color based on adjacent cell text color
    By matthewst in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-01-2005, 03:49 PM

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