Forum Discussion

Celia9's avatar
Celia9
Brass Contributor
Jul 26, 2022
Solved

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...
  • HansVogelaar's avatar
    Jul 26, 2022

    Celia9 

    Sub HideCols()
        Dim cell As Range
        For Each cell In Range("I11:BH11")
            cell.EntireColumn.Hidden = (cell.Value <> "X")
        Next cell
    End Sub

Resources