Sub ListSheetNamesInNewWorkbook()
Dim objNewWorkbook As Workbook
Dim objNewWorksheet As Worksheet
Set objNewWorkbook = Excel.Application.Workbooks.Add
Set objNewWorksheet = objNewWorkbook.Sheets(1)
For i = 1 To ThisWorkbook.Sheets.Count
objNewWorksheet.Cells(i, 1) = i
objNewWorksheet.Cells(i, 2) = ThisWorkbook.Sheets(i).Name
Next i
With objNewWorksheet
.Rows(1).Insert
.Cells(1, 1) = "INDEX"
.Cells(1, 1).Font.Bold = True
.Cells(1, 2) = "NAME"
.Cells(1, 2).Font.Bold = True
.Columns("A:B").AutoFit
End With
Sub ListSheetNamesInNewWorkbook() Dim objNewWorkbook As Workbook Dim objNewWorksheet As Worksheet
End Sub
excel #macro