• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Highlight Text within bracket to Red

PSG

Member
Hello All,

I need your help to create / Find any code which can turn any text / Number within bracket to Red.

Ex.

I have emails copied to (Turn me Red): Email Owners (Turn me Red) Name
Excel - Move (Turn me Red) Data In A Cell (Turn me Red) To Another Cell
Remove Text With (Turn me Red) Brackets & The Parenthesis
How to extract text between (Turn me Red) commas/brackets/parentheses

There can be multiple instances of this in a single line.

Thank You
 
Hello Faseeh,

Thank you for your prompt response. But this is useful only when I am manually adding text and brackets in a cell. My problem is I am copy pasting information from multiples sheet to a summary tab. Where I want to highlight text / number within bracket.

I hope I am making myself clear and causing no confusion.
 
Hi PSG,

I just tried on sheet 2, even if you copy from it and paste on sheet1 it is working. can you verify it?
 
Hello Faseesh,

Not working here. Run time error coming at

Code:
Text = Target.Text

Let me know if you have an alternative method or code
 
Hello Faseeh,

I think, I got it.
Code:
Sub test()

    Dim Text As String
    Dim Index1 As Long
    Dim Index2 As Long
    Dim i As Integer
  
  
    For i = 1 To 100
    Text = Cells(i, 3).Text
    Index2 = 1
    Do
        Index1 = InStr(Index2, Text, "(")
        If Index1 = 0 Then Exit Do
        Index2 = InStr(Index1, Text, ")")
        If Index2 = 0 Then Exit Do
        Cells(i, 3).Characters(Index1 + 1, Index2 - Index1 - 1).Font.Color = &HFF
    Loop
    Next i
End Sub

Thank you for the help
 
Back
Top