VBA code to change font color from red to black

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,012
Office Version
365
Platform
Windows
Will the "in (-)" only ever be in red?
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,012
Office Version
365
Platform
Windows
Ok, how about
Code:
Sub gubertu()
   Dim Ws As Worksheet
   
   With Application
      .FindFormat.Clear
      .FindFormat.Font.Color = 255
      .ReplaceFormat.Clear
      .ReplaceFormat.Font.ColorIndex = xlAutomatic
   End With
   
   For Each Ws In Worksheets
      Ws.UsedRange.Replace "", "", xlPart, , , , True, True
   Next Ws
   With Application
      .FindFormat.Clear
   End With
   For Each Ws In Worksheets
      Ws.UsedRange.Replace "in (-)", "in (-)", xlPart, , , , False, True
   Next Ws
   Application.ReplaceFormat.Clear
End Sub
 

gubertu

Board Regular
Joined
May 24, 2015
Messages
102
This is just what I wanted. Thanks very much for your help!! This code is great!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,012
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,090,241
Messages
5,413,265
Members
403,468
Latest member
GRamos

This Week's Hot Topics

Top