• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

hide worksheets

ahhhmed

Member
Hi all,

I have a workbook of several worksheets. I have a worksheet at the beginning with an index to all the other worksheets with hyperlinks. When I click on a hyperlink, the related worksheet opens.

Now I want to hide all the worksheets. I did this. But when I click on the hyperlinks in the index worksheets, nothing happens - the wanted worksheet does not come to view. How can I make it appear?

All help and ideas are welcome.
 
Ahhhmed


You need to add a macro to the Hyperlink cells to Hide all teh sheets and keep 1 open


can you post your file ?
 
@ahhhmed


Hi


Please post a sample workbook as per Hui sir instruct other wise if you will get some idea with code then follow the below link


http://chandoo.org/forums/topic/how-do-i-create-hyperlinks-in-excel-that-open-hidden-worksheets


Thanks


SP
 
Hi, ahhhmed!


If you have a 1st worksheet that's the only one visible at open time, and there you have hyperlinks to open selected folders, why not just adding two simple command buttons, one on each sheet except 1st and one in first sheet?


The common to all sheets except 1st, should hide that sheet; the other in 1st sheet should add all sheets but current.


The code behind those buttons might be the same, like this:

-----

[pre]
Code:
Option Explicit

Private Sub CommandButton1_Click()
HideSheets
End Sub
-----


And in any module place the called code:

-----

Option Explicit

Sub HideSheets()
Const ksWS1 = "Hoja1"
Dim I As Integer
If ActiveSheet.Name = ksWS1 Then
For I = 1 To Worksheets.Count
If Worksheets(I).Name <> ksWS1 Then Worksheets(I).Visible = False
Next I
Else
ActiveSheet.Visible = False
End If
End Sub
[/pre]
-----


Where ksWS1 constant holds the name of 1st sheet.


Regards!
 
Back
Top