Excel Automatically hide Excel rows

Joined
Mar 4, 2010
Messages
1
Reaction score
0
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
 

Ian

Administrator
Joined
Feb 23, 2002
Messages
19,873
Reaction score
1,499
feckit said:
You have posted twice, do you have 2 problems or 1, i'm confused?:p

That was just me moving the thread to a new forum :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top