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

Leave a Reply

Your email address will not be published.Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.