Option Explicit
Sub main()
Dim tWB As Workbook
Dim wdS As Window
Dim mNL As Collection
Dim str As Variant
Dim arrStr as String
Dim i As Long
Set mNL = makeAllSheetNameList()
Set tWB = ThisWorkbook
Set wdS = tWB.Windows(1)
i = 1
'マクロ実行ファイルのシート1に転記
For Each str In mNL
if i = 1 then arrStr = str
if i > 1 then arrStr = arrStr + "," + str
i = i + 1
Next
tWB.Worksheets(1).Range("A" & i) ="array(" & arrStr & ")"
wdS.WindowState = xlMaximized
'MsgBox "完了", vbOKOnly, "メッセージ"
End Sub
Function makeAllSheetNameList() As Collection
'アクティブブックのシート名をコレクションに詰めて返す
Dim i As Variant
Dim nameList As Collection
Set nameList = New Collection
For Each i In Sheets
nameList.Add (i.Name)
Next
Set makeAllSheetNameList = nameList
End Function