I am trying to get this to load the sheets and show in column 2 whether the sheet is hidden or not. It load all but add an extra blank line in the listbox at the bottom
I am using a listbox set to 2 columns with no columnheads
Sub ListSheets()
Dim i As Long
UserForm1.ListBox_Sheet.Clear
ReDim MyArray(ActiveWorkbook.Worksheets.Count, 1)
For i = 0 To ActiveWorkbook.Worksheets.Count - 1
MyArray(i, 0) = Sheets(i + 1).Name
If Sheets(MyArray(i, 0)).Visible = xlSheetHidden Then MyArray(i, 1) = "Hidden"
If Sheets(MyArray(i, 0)).Visible = xlSheetVeryHidden Then MyArray(i, 1) = "Very Hidden"
Next i
UserForm1.ListBox_Sheet.List = MyArray
End Sub
Bookmarks