Forum Discussion
Celia9
Jul 26, 2022Brass Contributor
Macro to hide columns in a range that do not contain
Hello, I found a macro that almost fits my needs, can someone help me out to complete? I want to hide columns between range I:BH based on what is not in the cell in row 11 Sub HideCols...
- Jul 26, 2022
Sub HideCols() Dim cell As Range For Each cell In Range("I11:BH11") cell.EntireColumn.Hidden = (cell.Value <> "X") Next cell End Sub
NikolinoDE
Jul 26, 2022Platinum Contributor
Sub HideCols()
Columns("I:BH").EntireColumn.Hidden = (Range("A11") = "X")
End Sub
Columns("I:BH").EntireColumn.Hidden = (Range("A11") = "X")
End Sub
Celia9
Jul 26, 2022Brass Contributor
But this just looks to A11. It needs to look in each column at row 11.