Skip to content

Instantly share code, notes, and snippets.

@snaka
Created November 1, 2012 07:46
Show Gist options
  • Select an option

  • Save snaka/3992351 to your computer and use it in GitHub Desktop.

Select an option

Save snaka/3992351 to your computer and use it in GitHub Desktop.
excelシートの一覧
Sub create_sheet_index()
Dim idx As Range
Dim i As Integer
' #index という名前のシートに出力
Set idx = Worksheets("#index").Cells(3, 2)
i = 1
For Each sht In ActiveWorkbook.Worksheets
' シート名の頭が#は取り込まない
If Left(sht.Name, 1) <> "#" Then
idx = CStr(i)
idx.Offset(, 1) = sht.Name
' 次の表示位置へ
Set idx = idx.Offset(1)
i = i + 1
End If
Next
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment