hello & thank you for considering this insanity I'm looking to do!
In the screenshots...
#1 shows a "named range" I'd like to have the rows filled with a light gray.
#2 shows random colors that could be in any of those cells in the named range
#3 shows the result I'd like to see which is to fill any cell with "no fill" to light gray
I have the following code which tests each cell in a range to see if it's gray & if so, change to "no fill"
Would it be possible to pass a "named range" into this code to accomplish #3 from above.
Many thanks for your time!
Steve
Sub TestFillColor()
Dim cell As Range
'Loop through each cell in selected range
For Each cell In Selection.Cells
'Test if cell has a fill color
If cell.Interior.Color = RGB(242, 242, 242) Then
'change to no fill
cell.Interior.Color = RGB(255, 255, 255)
End If
Next cell
End Sub
In the screenshots...
#1 shows a "named range" I'd like to have the rows filled with a light gray.
#2 shows random colors that could be in any of those cells in the named range
#3 shows the result I'd like to see which is to fill any cell with "no fill" to light gray
I have the following code which tests each cell in a range to see if it's gray & if so, change to "no fill"
Would it be possible to pass a "named range" into this code to accomplish #3 from above.
Many thanks for your time!
Steve
Sub TestFillColor()
Dim cell As Range
'Loop through each cell in selected range
For Each cell In Selection.Cells
'Test if cell has a fill color
If cell.Interior.Color = RGB(242, 242, 242) Then
'change to no fill
cell.Interior.Color = RGB(255, 255, 255)
End If
Next cell
End Sub