Results 1 to 3 of 3

Command Button to open hidden sheet and close when de- selected

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-07-2020
    Location
    New Zealand
    MS-Off Ver
    365
    Posts
    219

    Command Button to open hidden sheet and close when de- selected

    Hi There

    I have a code below that I have on my index sheet. All my other sheets besides the INDEX sheet is hidden. As soon as i select the sheet name "Dashboard" on the index sheet hyperlinked to the "Dashboard" sheet it opens that sheet. When I click the index sheet again the open sheet "Dashboard" is hidden again

    I want to change the code a bit and link it to a command button. The command buttons name will be DASHBOARD as soon as I select the command button I want want it to open the DASHBOARD sheet, when I then click the unhiden index sheet the DASHBOARD sheet will hide again

    Could someone perhaps help me in the right direction

    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
       'Updateby Extendoffice 20161109
        Application.ScreenUpdating = False
        Dim strLinkSheet As String
        If InStr(Target.Parent, "!") > 0 Then
            strLinkSheet = Left(Target.Parent, InStr(1, Target.Parent, "!") - 1)
        Else
            strLinkSheet = Target.Parent
        End If
        Sheets(strLinkSheet).Visible = True
        Sheets(strLinkSheet).Select
        Application.ScreenUpdating = True
    End Sub
     
    Private Sub Worksheet_Activate()
        On Error Resume Next
        Sheets(ActiveCell.Value2).Visible = False
    End Sub
    Last edited by Chris1976; 05-05-2020 at 05:17 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. command button to Save As sheet in new workook and Close options to hide sheet
    By AmandaM73 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2018, 03:59 AM
  2. Open/Save/Close Workbook via command button
    By nathan0519 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2015, 11:24 PM
  3. Macro to Hyperlink Command Button to open Selected Folders From a List Box
    By zaska in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2015, 11:05 PM
  4. [SOLVED] Need Help With Coding Command Button to Close Sheet Text Box
    By mandora in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2014, 04:39 PM
  5. [SOLVED] copy selected row and paste it to another sheet command button vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-22-2014, 03:22 AM
  6. Open a hidden sheet with clicking a button
    By Fixxxer1234 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-14-2014, 11:00 PM
  7. Replies: 2
    Last Post: 02-13-2011, 01:22 PM

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