Zach
Member
I'm working within a spreadsheet that had many many columns of data, based on the data certain columns are colored a light Yellow: RGB(255, 255, 102). Before I have to report the data I manually go through and hide all these columns, sometimes it can be large amount, so I'm trying to get a marco to just hide the columns based on the color. This is what I came up with but I'm not skilled enough to know what I'm missing.
I went ahead and created a template that color coded cells in row 4 as the columns I will need to hide each time(these will never change).
Can someone put me on the right path to fixing my mixed up Macro?
I went ahead and created a template that color coded cells in row 4 as the columns I will need to hide each time(these will never change).
Code:
Dim cell As Range
For Each cell In Range("4:4")
If cell.Interior.ColorIndex = RGB(255, 255, 102) Then
Columns("A:ZZ").EntireColumn.Hidden = True
Exit Sub
End Sub