How to fill in non-colored cells to gray

dmb41

Board Regular
Joined
Nov 10, 2010
Messages
75
I have several cells color-coded (based on frequency) but there are many white, non-colored, cells which I need to color gray.

Is there any way to color all these non-colored cells quickly, as I have many sheets to do.

Seems like an easy logic I just cant find a simple way to do it.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Wouldn't that just fill in all the cells that have already been colored (a different color, through a java program) to gray?

I have something like the following:

(With different text in each)

A1 = RED B1 = BLUE
A2 = BLUE B2 = RED
A3 = NO COLOR B3 = RED
A4 = NO COLOR B4 = NO COLOR
A5 = NO COLOR B5 = NO COLOR

I am looking to color the cells (in this example: A3,A4,A5,B4,B5) gray and leave the existing cells a color.

I know I could just use CTRL and highlight all blank - but there is too many sheets...

Hope this helps clarify the issue.
 
Upvote 0
With your test data this works.

Highlight range >> Alt + F8 >> ChangeColors >> Run

Code:
Sub ChangeColors()
    Dim cell As Range
    For Each cell In Selection
        If cell.Interior.Color = RGB(255, 255, 255) Then
            cell.Interior.ColorIndex = 16
        End If
    Next cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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