Macro to Hide and Unhide Rows and Columns in Excel


Hide Specific Row/Rows of a Worksheet


Sub HideRows()
Rows("5:10").EntireRow.Hidden = True
End Sub

Unhide Specific Row/Rows of a Worksheet


Sub UnHideRows()
Rows("5:10").EntireRow.Hidden = False
End Sub

Unhide Every hidden Row of a Worksheet


Sub UnhideAllRows()
Cells.EntireRow.Hidden = False
End Sub

Hide Specific Column/Columns of a Worksheet


Sub HideColumns()
Columns("B:D").EntireColumn.Hidden = True
End Sub

Unhide Specific Column/Columns of a Worksheet


Sub UnHideColumns()
Columns("B:D").EntireColumn.Hidden = False
End Sub

Unhide Every hidden Column of a Worksheet


Sub UnhideAllColumns()
Cells.EntireColumn.Hidden = False
End Sub

How to use codes shared here?