Excel 2007
I have a macro on an excel workbook which enables rows within a sheet to be hidden if their value is 0.
However at the moment I have to trawl through each worksheet to hide and unhide the rows.
Is there a macro which would enable me to do this on all worksheets at the press of one button.
Thank you.
This is the macro in place at the moment.
Sub hide_unused()
'
'MACROS BY EXCELZOOM.COM
Application.ScreenUpdating = False
Range("a7:a2000").Select
Rng = Selection.Rows.Count
For i = 1 To Rng
If ActiveCell = 0 Then
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else: Selection.EntireRow.Hidden = False
ActiveCell.Offset(1, 0).Select
End If
Next i
Application.ScreenUpdating = True
End Sub
I have a macro on an excel workbook which enables rows within a sheet to be hidden if their value is 0.
However at the moment I have to trawl through each worksheet to hide and unhide the rows.
Is there a macro which would enable me to do this on all worksheets at the press of one button.
Thank you.
This is the macro in place at the moment.
Sub hide_unused()
'
'MACROS BY EXCELZOOM.COM
Application.ScreenUpdating = False
Range("a7:a2000").Select
Rng = Selection.Rows.Count
For i = 1 To Rng
If ActiveCell = 0 Then
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else: Selection.EntireRow.Hidden = False
ActiveCell.Offset(1, 0).Select
End If
Next i
Application.ScreenUpdating = True
End Sub