+ Reply to Thread
Results 1 to 4 of 4

Bringing up the Unhide Sheet list via macro

  1. #1
    PCLIVE
    Guest

    Bringing up the Unhide Sheet list via macro

    Is it possible to bring up the Sheet Unhide window using a macro?
    Basically, there may be several sheets that are hidden. I want this macro
    to bring up the Sheets Unhide window so that I can then select the sheet
    that I want to unhide. When I know the sheet name, I know I can unhide that
    sheet with the following:

    Sheets("SheetName").Visible = True

    But if you don't know the sheet name and you just want to bring up a list,
    you would normally have to click on Format-Sheet-Unhide.
    Can this been done using a macro?

    Thanks,
    Paul



  2. #2
    RB Smissaert
    Guest

    Re: Bringing up the Unhide Sheet list via macro

    Try this:


    Sub Test()

    Dim bDialogResult As Boolean

    bDialogResult = bShowDialog(xlDialogWorkbookUnhide)

    MsgBox bDialogResult

    End Sub


    Function bShowDialog(iDialog As Integer) As Boolean

    Dim oDialog As Dialog

    Set oDialog = Application.Dialogs(iDialog)

    bShowDialog = oDialog.Show

    End Function


    If needed you can use the result of the dialog; that is if a sheet was
    indeed unhidden or if the
    dialog was cancelled. Note that you can use the function for other dialogs
    as well.


    RBS


    "PCLIVE" <[email protected]> wrote in message
    news:[email protected]...
    > Is it possible to bring up the Sheet Unhide window using a macro?
    > Basically, there may be several sheets that are hidden. I want this macro
    > to bring up the Sheets Unhide window so that I can then select the sheet
    > that I want to unhide. When I know the sheet name, I know I can unhide
    > that sheet with the following:
    >
    > Sheets("SheetName").Visible = True
    >
    > But if you don't know the sheet name and you just want to bring up a list,
    > you would normally have to click on Format-Sheet-Unhide.
    > Can this been done using a macro?
    >
    > Thanks,
    > Paul
    >



  3. #3
    RB Smissaert
    Guest

    Re: Bringing up the Unhide Sheet list via macro

    Actually, I am not sure the funtion has any purpose.
    Maybe this is just simpler:

    Sub test()

    Dim bDialogResult As Boolean

    bDialogResult = Application.Dialogs(xlDialogWorkbookUnhide).Show

    MsgBox bDialogResult

    End Sub

    The nice thing is that typing the bracket after Dialogs, will bring up all
    the possible dialogs.
    Of course you may not be interested in the result of the dialog and then you
    could just do:
    Application.Dialogs(xlDialogWorkbookUnhide).Show


    RBS


    "RB Smissaert" <[email protected]> wrote in message
    news:[email protected]...
    > Try this:
    >
    >
    > Sub Test()
    >
    > Dim bDialogResult As Boolean
    >
    > bDialogResult = bShowDialog(xlDialogWorkbookUnhide)
    >
    > MsgBox bDialogResult
    >
    > End Sub
    >
    >
    > Function bShowDialog(iDialog As Integer) As Boolean
    >
    > Dim oDialog As Dialog
    >
    > Set oDialog = Application.Dialogs(iDialog)
    >
    > bShowDialog = oDialog.Show
    >
    > End Function
    >
    >
    > If needed you can use the result of the dialog; that is if a sheet was
    > indeed unhidden or if the
    > dialog was cancelled. Note that you can use the function for other dialogs
    > as well.
    >
    >
    > RBS
    >
    >
    > "PCLIVE" <[email protected]> wrote in message
    > news:[email protected]...
    >> Is it possible to bring up the Sheet Unhide window using a macro?
    >> Basically, there may be several sheets that are hidden. I want this
    >> macro to bring up the Sheets Unhide window so that I can then select the
    >> sheet that I want to unhide. When I know the sheet name, I know I can
    >> unhide that sheet with the following:
    >>
    >> Sheets("SheetName").Visible = True
    >>
    >> But if you don't know the sheet name and you just want to bring up a
    >> list, you would normally have to click on Format-Sheet-Unhide.
    >> Can this been done using a macro?
    >>
    >> Thanks,
    >> Paul
    >>

    >



  4. #4
    PCLIVE
    Guest

    Re: Bringing up the Unhide Sheet list via macro

    I didn't really need the message box, but it works.

    Thanks.
    Paul

    "RB Smissaert" <[email protected]> wrote in message
    news:[email protected]...
    > Actually, I am not sure the funtion has any purpose.
    > Maybe this is just simpler:
    >
    > Sub test()
    >
    > Dim bDialogResult As Boolean
    >
    > bDialogResult = Application.Dialogs(xlDialogWorkbookUnhide).Show
    >
    > MsgBox bDialogResult
    >
    > End Sub
    >
    > The nice thing is that typing the bracket after Dialogs, will bring up all
    > the possible dialogs.
    > Of course you may not be interested in the result of the dialog and then
    > you could just do:
    > Application.Dialogs(xlDialogWorkbookUnhide).Show
    >
    >
    > RBS
    >
    >
    > "RB Smissaert" <[email protected]> wrote in message
    > news:[email protected]...
    >> Try this:
    >>
    >>
    >> Sub Test()
    >>
    >> Dim bDialogResult As Boolean
    >>
    >> bDialogResult = bShowDialog(xlDialogWorkbookUnhide)
    >>
    >> MsgBox bDialogResult
    >>
    >> End Sub
    >>
    >>
    >> Function bShowDialog(iDialog As Integer) As Boolean
    >>
    >> Dim oDialog As Dialog
    >>
    >> Set oDialog = Application.Dialogs(iDialog)
    >>
    >> bShowDialog = oDialog.Show
    >>
    >> End Function
    >>
    >>
    >> If needed you can use the result of the dialog; that is if a sheet was
    >> indeed unhidden or if the
    >> dialog was cancelled. Note that you can use the function for other
    >> dialogs as well.
    >>
    >>
    >> RBS
    >>
    >>
    >> "PCLIVE" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Is it possible to bring up the Sheet Unhide window using a macro?
    >>> Basically, there may be several sheets that are hidden. I want this
    >>> macro to bring up the Sheets Unhide window so that I can then select the
    >>> sheet that I want to unhide. When I know the sheet name, I know I can
    >>> unhide that sheet with the following:
    >>>
    >>> Sheets("SheetName").Visible = True
    >>>
    >>> But if you don't know the sheet name and you just want to bring up a
    >>> list, you would normally have to click on Format-Sheet-Unhide.
    >>> Can this been done using a macro?
    >>>
    >>> Thanks,
    >>> Paul
    >>>

    >>

    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1