Consulting

Results 1 to 4 of 4

Thread: unhiding all rows in all worksheets

  1. #1

    unhiding all rows in all worksheets

    I have a workbook with 12 worksheets all of which have hidden rows. Is it possible to run a macro that:

    1. asks the user for a predefined password
    2. unhides all hidden rows upon entering the secret word
    I 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

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Thanks; where is "mypassword" defined?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It isn't, you have to use your password there.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •