Macro Tutorial – Hide and Unhide rows in Microsoft Excel (Hide/Unhide VBA code)
In this tutorial we outline how to write a macro in Excel which will hide or unhide defined rows when executed. This has a wide number of applications.
If you are new to Excel macros please follow this playlist to then get started with this tutorial.
The code that we have used in this example is as follows. Paste this between “private sub” and “end sub” and edit the rows to fit your purpose.
If Selection.EntireRow.Hidden = True Then
Selection.EntireRow.Hidden = False
Selection.EntireRow.Hidden = True
To download this workbook please click the following link.