View Single Post
 
Old 01-22-2023, 02:42 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

It would be a lot faster to customise the color palette and apply that to your cells. In the future you just change the color in the palette.

This macro has two parts. The first part is searching all cells to find the RGB values and assign the first accent color. The final line changes the accent color in the palette.
Code:
Sub RecolorMe()
  Dim iCol As Long, aCell As Range, aWS As Worksheet
  For Each aWS In ActiveWorkbook.Sheets
    For Each aCell In aWS.UsedRange.Cells
      If aCell.Interior.Color = RGB(220, 230, 241) Then
        aCell.Interior.ThemeColor = xlThemeColorAccent1
      End If
    Next aCell
  Next aWS
  
  'Change the theme color
  ActiveWorkbook.Theme.ThemeColorScheme.Colors(msoThemeAccent1) = RGB(253, 233, 217)
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote