Hide specific name from list

  • Thread starter Thread starter Shaz
  • Start date Start date
S

Shaz

Hi all
The following macro will list all the worksheets and create hyperlink
except that it will also include a "hidden" worksheet "Score".
How can I exclude this worksheet from being shown?

TIA
Shaz

Sub CreateLinks()
'Set visible area of cells where links will be placed
Set MyR = Range("k2:k100")
MyR.Clear
cnt = Worksheets.Count
x = 0
While x < cnt
For Each c In MyR.Cells
x = x + 1
c.Select
If x > cnt Then Exit Sub
shName = Worksheets(x).Name
ActiveSheet.Hyperlinks.Add Selection, "", shName &
"!A1"
c = shName
Next
Wend
Set MyR = Nothing
End Sub
 
Try this. Change the comment to unhide. The only way to unhide is with the
macro.

Sub hidesheet()
Sheets("sheet11").Visible = xlVeryHidden
'Sheets("sheet11").Visible = True
End Sub
 
Thanks for the response Don.
I already do this however the name will still appear albeit crippled.
I also looked at Dave McRitchies Build TOC but the code setup far too
much. Any ideas?

Shaz
 
Since that will list only *hidden* sheets, I suspect you mean

If wsSheet.Name <> Me.Name And wsSheet.Visible = True
 
Thank you all. I will give it a try.

Shaz


JE McGimpsey said:
Since that will list only *hidden* sheets, I suspect you mean

If wsSheet.Name <> Me.Name And wsSheet.Visible = True
 
Back
Top