Define Range based on cell color
Sub tester1()
Columns.Hidden = False
For Each cell In ActiveSheet.UsedRange
If cell.Interior.ColorIndex = 37 Or cell.Interior.ColorIndex = 34 Then
cell.EntireColumn.Hidden = True
End If
Next
End Sub
--
Regards,
Tom Ogilvy
"StephanieH" wrote in message
...
Is it possible to define a range based on cell color? What I'd like to do
is
hide/unhide all columns containing cells with the background colors 34 and
37. After reading Dave Pearson's information, it seems possible but I
have
no idea how to make it work.
|