Finding no-fill cells

cmeier7

Board Regular
Joined
Jul 23, 2009
Messages
64
Hello, I want to determine if certain cells are filled or not filled. I also need to assign a white fill to another cell based on if the cell is white or not filled. I have:

Code:
ElseIf Sheets(n).Cells(b, 7).Interior.ColorIndex = 2 Or 0 Then
        With Sheets("Results_STEEL").Cells(r, c)
            .Interior.ColorIndex = 2
        End With

It works with white (ci of 2) but the code does not recognize 0 as a color index. How should I go about doing this? Thanks in advance.

-cmeier7
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try

Code:
ElseIf Sheets(n).Cells(b, 7).Interior.ColorIndex = 2 Or Sheets(n).Cells(b, 7).Interior.ColorIndex = xlNone Then
 
Upvote 0
Excel still does not recognize a no fill as = x1None.

Code:
If Sheets(n).Cells(b, 3).Interior.ColorIndex = 15 Then
        GoTo Continue01
    ElseIf Sheets(n).Cells(b, 3).Interior.ColorIndex = 2 Or x1None Then
        With Sheets("Results_STEEL").Cells(r, c)
            .Interior.ColorIndex = 2
        End With
    Else
        MsgBox ("One of the cells being analyzed is a different color than 25% gray or white.  Please check this and try again.")
        Exit Sub
    End If

If it comes to a no-fill cell, it continues to produce the message box. Yet I still want it to make the fill white.
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,111
Members
449,205
Latest member
ralemanygarcia

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