Hide macro

5 pts.
Tags:
Excel macros
Macros
Microsoft Excel macros
I want to use a macro that will hide rows in the range of 17 to 61 where a value in column B is 0 on a protected sheet.  This has to be automatic (multi-user friendly) rather than using advanced filtering.

Software/Hardware used:
Excel 2007 Vista

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can use this one. You can select whatever range you want.
………………………………………………………………………………………………………
Sub hidingrows()
Dim i As Integer
Dim m As Integer
Dim h As Integer

Sheets(“sheet2″).Select
Range(“a4″).Select
m = Range(Selection, Selection.End(xlDown)).Count
h = 0
For i = 1 To m
Range(“a4″).Offset(h, 0).Select
If Selection.Value = 0 Then
Selection.EntireRow.Hidden = True
End If
h = h + 1
Next
End Sub
……………………………………………………………………………………………………………

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following