PDA

View Full Version : unhiding all rows in all worksheets



K. Georgiadis
02-07-2009, 02:13 PM
I have a workbook with 12 worksheets all of which have hidden rows. Is it possible to run a macro that:


asks the user for a predefined password
unhides all hidden rows upon entering the secret wordI suppose it would be too much to expect that Excel would remember the previously hidden rows and hide them again upon running a reverse macro!

Thanks,

KG

Bob Phillips
02-07-2009, 02:36 PM
Dim pwd As String
Dim sh As Worksheet

pwd = InputBox("Supply passwrd")
If pwd = "mypassword" Then

For Each sh In ThisWorkbook.Worksheets

Cells.EntireRow.Hidden = False
Next sh
End If

K. Georgiadis
02-07-2009, 03:02 PM
Thanks; where is "mypassword" defined?

Bob Phillips
02-07-2009, 03:10 PM
It isn't, you have to use your password there.