H
Hennie Neuhoff
Hi All,
I use the following code from which the user can select the relevant page
[sheet].
The workbook includes hidden[xlVeryHidden] sheets, which is also displayed but
can't be selected.
Any ideas [if it's possible??] to exclude hidden sheets from this code. [Xl
2003]
Public Sub Sheets_In_Dialog()
Dim J As Integer, N As Integer
Dim sName As String
Dim oSheet As Object
GetPage:
UserForm10.ListBox1.Clear
With UserForm10.ListBox1
For Each oSheet In Sheets
If TypeName(oSheet) = "Worksheet" Or _
TypeName(oSheet) = "Chart" Then
.AddItem oSheet.Name
End If
Next
End With
UserForm10.Show
N = UserForm10.ListBox1.ListIndex
With UserForm10.ListBox1
If .ListIndex = -1 Then
MsgBox ("No selection made")
GoTo GetPage
End If
End With
sName = UserForm10.ListBox1.Value
Set oSheet = Sheets(sName)
oSheet.Activate
Unload UserForm10
End Sub
I use the following code from which the user can select the relevant page
[sheet].
The workbook includes hidden[xlVeryHidden] sheets, which is also displayed but
can't be selected.
Any ideas [if it's possible??] to exclude hidden sheets from this code. [Xl
2003]
Public Sub Sheets_In_Dialog()
Dim J As Integer, N As Integer
Dim sName As String
Dim oSheet As Object
GetPage:
UserForm10.ListBox1.Clear
With UserForm10.ListBox1
For Each oSheet In Sheets
If TypeName(oSheet) = "Worksheet" Or _
TypeName(oSheet) = "Chart" Then
.AddItem oSheet.Name
End If
Next
End With
UserForm10.Show
N = UserForm10.ListBox1.ListIndex
With UserForm10.ListBox1
If .ListIndex = -1 Then
MsgBox ("No selection made")
GoTo GetPage
End If
End With
sName = UserForm10.ListBox1.Value
Set oSheet = Sheets(sName)
oSheet.Activate
Unload UserForm10
End Sub