Find/replace > change to red

richiwatts

Board Regular
Joined
Aug 27, 2002
Messages
131
Hi,

We have exported our database to Excel and we need to change th ecolour of our variables to red:

We have cells like this:
The property offers ${BusinessAmty}.
This property has ${RecFacilities}, ${RecFacilities}, and ${RecFacilities}.

How do I change all the different ${*} to red.
I know how to do it with Wildcards in Word but do not know how to do this in Excel.
Thanks for your help
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Perhaps next piece of code could help.
It turns cell's font in red when exist $ and { and } for the actve sheet
Code:
[/FONT][/COLOR]
[COLOR=black][FONT=Verdana][COLOR=black][FONT=Verdana]Option Explicit[/FONT][/COLOR][/FONT][/COLOR]
[COLOR=black][FONT=Verdana][COLOR=black][FONT=Verdana]Sub Change_Red()
Dim F As Object
Dim Test1 As Boolean
Dim Test2 As Boolean
Dim Test3 As Boolean
    For Each F In ActiveSheet.UsedRange
        Test1 = False: Test2 = False: Test3 = False
        Test1 = (Len(F.Value) - Len(Replace(F.Value, "$", ""))) >= 1
        Test2 = (Len(F.Value) - Len(Replace(F.Value, "{", ""))) >= 1
        Test3 = (Len(F.Value) - Len(Replace(F.Value, "}", ""))) >= 1
        If (Test1 And Test2 And Test3) Then F.Font.ColorIndex = 3
    Next F
End Sub
[/FONT][/COLOR][/FONT][/COLOR]
[COLOR=black][FONT=Verdana]
 
Upvote 0
Hi Try this:-
Code:
Sub ColRed()
Dim cl As Range, Txt, oTxt, Red, Lg
For Each cl In ActiveSheet.UsedRange
    If InStr(cl, "$") Then
       For Red = 1 To Len(cl)
           If Mid(cl, Red, 1) = Chr(36) Then
                Lg = InStr(Red, cl, Chr(125), vbTextCompare)
                    cl.Characters(Red, Lg - Red + 1).Font.ColorIndex = 3
                End If
            Next Red
        End If
Next cl
End Sub
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,956
Members
449,200
Latest member
indiansth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top