Macro to hide rows

volkl77

Board Regular
Joined
Apr 5, 2008
Messages
76
I am still in need of some help with a macro. I need a macro that will do the following. :confused:

-unprotect the sheet (can i have a password assigned and still do this, that would be ideal)
-hide all rows in the range $A$22:$I$171 where column "E" is empty
-re-protect the sheet (with password if possible)

any help with this would be very much appreciated. Thanks!!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Look this




If Rows("1:10").EntireRow.Hidden = True Then
Rows("1:10").EntireRow.Hidden = False
ElseIf Rows("1:10").EntireRow.Hidden = False Then
Rows("1:10").EntireRow.Hidden = True
End If

End Sub
 
Upvote 0
Other exemple follows..

Sub HideRow()
Plan1.Rows("1").Hidden = True
Plan1.Rows("3").Hidden = True
End Sub
 
Upvote 0
I'd record a macro unprotecting the sheet, apply Auto Filter on column E for blanks, then reprotect.

The recorder won't trap the password, but you can easily add it:

ActiveSheet.Unprotect "PasswordHere"
' Your code
ActiveSheet.Protect "PasswordHere"

HTH
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top