VBA Help Need to remove the orange color

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
1,010
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,

I have almost 20+ Sheet and i would like to remove the orange color where ever we have in the cell

RGB: 255,150,0 need to remove from the cell and then the font should be grey after removing the orange color

Book1
ABCDEFGHIJKLMNOPQRS
1TV (2H Categories - 6/1 Through End of Campaign) - Dayparts: 6AM to 10AMTV (2H Categories - 6/1 Through End of Campaign) - Dayparts: 10AM to 4PMTV (2H Categories - 6/1 Through End of Campaign) - Dayparts: 4PM to 8PMTV (2H Categories - 6/1 Through End of Campaign) - Dayparts: 8PM to 11PMTV (2H Categories - 6/1 Through End of Campaign) - Dayparts: 11PM to 2AMTV (2H Categories - 6/1 Through End of Campaign) - Dayparts: 2AM to 6AM
2ControlExposedDeltaControlExposedDeltaControlExposedDeltaControlExposedDeltaControlExposedDeltaControlExposedDelta
325.1%46.3%21.2%25.1%37.6%12.5%25.1%30.3%5.2%25.1%29.0%3.9%25.1%31.4%6.3%25.1%47.9%22.9%
452.0%64.2%12.2%52.0%66.7%14.7%52.0%73.4%21.5%52.0%64.3%12.4%52.0%65.7%13.7%52.0%70.8%18.9%
561.3%65.7%4.4%61.3%70.2%8.9%61.3%71.4%10.1%61.3%65.6%4.3%61.3%61.3%0.0%61.3%68.8%7.5%
6
7
8
9
10Need to remove where ever orane we have
11RGB 2551500
Sheet1
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try this:

VBA Code:
Sub ChangeColor()
  Dim sh As Worksheet
  Dim f As Range
  
  Application.FindFormat.Clear
  Application.FindFormat.Interior.Color = 38655   'RGB   255 150 0

  For Each sh In Sheets
    Do
      Set f = sh.Cells.Find("*", , xlFormulas, xlWhole, , , False, , True)
      If Not f Is Nothing Then
        f.Interior.ColorIndex = xlNone
        f.Font.Color = -9342607                   'grey
      End If
    Loop While Not f Is Nothing
  Next

  Application.FindFormat.Clear
End Sub
 
Upvote 1
Solution
Try this:

VBA Code:
Sub ChangeColor()
  Dim sh As Worksheet
  Dim f As Range
 
  Application.FindFormat.Clear
  Application.FindFormat.Interior.Color = 38655   'RGB   255 150 0

  For Each sh In Sheets
    Do
      Set f = sh.Cells.Find("*", , xlFormulas, xlWhole, , , False, , True)
      If Not f Is Nothing Then
        f.Interior.ColorIndex = xlNone
        f.Font.Color = -9342607                   'grey
      End If
    Loop While Not f Is Nothing
  Next

  Application.FindFormat.Clear
End Sub

Wow!!!

Thank you so much DanteAmor :):)

Really Appreciate your help on this :)
 
Upvote 0
Try this:

VBA Code:
Sub ChangeColor()
  Dim sh As Worksheet
  Dim f As Range
 
  Application.FindFormat.Clear
  Application.FindFormat.Interior.Color = 38655   'RGB   255 150 0

  For Each sh In Sheets
    Do
      Set f = sh.Cells.Find("*", , xlFormulas, xlWhole, , , False, , True)
      If Not f Is Nothing Then
        f.Interior.ColorIndex = xlNone
        f.Font.Color = -9342607                   'grey
      End If
    Loop While Not f Is Nothing
  Next

  Application.FindFormat.Clear
End Sub

Hi Sir,

Can we have Grey background and White font?

Regards
Sanjeev
 
Upvote 0
Can we have Grey background and White font?
Of course:

Rich (BB code):
Sub ChangeColor()
  Dim sh As Worksheet
  Dim f As Range
  
  Application.FindFormat.Clear
  Application.FindFormat.Interior.Color = 38655   'RGB   255 150 0

  For Each sh In Sheets
    Do
      Set f = sh.Cells.Find("*", , xlFormulas, xlWhole, , , False, , True)
      If Not f Is Nothing Then
        f.Interior.Color = -9342607                   'grey
        f.Font.Color = vbWhite
      End If
    Loop While Not f Is Nothing
  Next

  Application.FindFormat.Clear
End Sub
 
Upvote 0
Of course:

Rich (BB code):
Sub ChangeColor()
  Dim sh As Worksheet
  Dim f As Range
 
  Application.FindFormat.Clear
  Application.FindFormat.Interior.Color = 38655   'RGB   255 150 0

  For Each sh In Sheets
    Do
      Set f = sh.Cells.Find("*", , xlFormulas, xlWhole, , , False, , True)
      If Not f Is Nothing Then
        f.Interior.Color = -9342607                   'grey
        f.Font.Color = vbWhite
      End If
    Loop While Not f Is Nothing
  Next

  Application.FindFormat.Clear
End Sub
Thank you so much :):) for your help on this...!!!
 
Upvote 1

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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