Kann mir da jemand helfen? Ich bin schon am verzweifeln. Vielen Dank
Private Sub Workbook_Open()
Load UserForm1
UserForm1.Show
End Sub
Private Sub CommandButton1_Click()
Dim i%, j%
j = 0
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
j = j + 1 'Merker für Anzahl ausgeblendete Sheets (1 muss mind. eingeblendet bleiben)
If j < ThisWorkbook.Sheets.Count Then _
Sheets(i + 1).Visible = xlSheetHidden
End If
Next i
Unload Me
End Sub
Private Sub UserForm_Initialize()
Dim i%
For i = 1 To ThisWorkbook.Sheets.Count
ListBox1.AddItem ThisWorkbook.Sheets(i).Name
Sheets(i).Visible = xlSheetVisible
Next i
ListBox1.Height = 200
ListBox1.MultiSelect = fmMultiSelectMulti
End Sub