Macro to Create the list of Worksheets in an Excel Workbook


Create a list of Worksheets present in a Workbook


Sub ListEverySheet()
Dim XNC As Worksheet
Dim X As Integer
X = 0
Sheets("List of WorkSheets").Select
Range("A2").Select
For Each XNC In ThisWorkbook.Sheets
ActiveCell.Offset(X, 0).Value = XNC.Name
X = X + 1
Next
End Sub

Create a list of Worksheet with Properties


Sub ListEverySheetWithProperties()
Dim XNC As Worksheet
Dim X As Integer
X = 0
Sheets("List of WorkSheets").Select
Range("A2").Select
For Each XNC In ThisWorkbook.Sheets
ActiveCell.Offset(X, 0).Value = XNC.Name
If XNC.Visible = True Then
ActiveCell.Offset(X, 1).Value = "Visible"
ElseIf XNC.Visible = xlSheetHidden Then
ActiveCell.Offset(X, 1).Value = "Hidden"
ElseIf XNC.Visible = xlSheetVeryHidden Then
ActiveCell.Offset(X, 1).Value = "Very Hidden"
End If
X = X + 1
Next
End Sub

How to use codes shared here?