Skip to content

Instantly share code, notes, and snippets.

@icm7216
Created June 14, 2016 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icm7216/2035414375262f583db53fd25917ceb8 to your computer and use it in GitHub Desktop.
Save icm7216/2035414375262f583db53fd25917ceb8 to your computer and use it in GitHub Desktop.
Excelワークブックに登録されたスタイルを数えるマクロ。
'ワークブックのスタイルをカウント
Sub count_workbook_styles()
On Error Resume Next
Dim bltin_count As Long
Dim not_bltin_count As Long
Dim s As Style
Dim bk As Workbook
Set bk = ActiveWorkbook
bltin_count = 0
not_bltin_count = 0
For Each s In bk.Styles
If s.BuiltIn Then
bltin_count = bltin_count + 1
Else
not_bltin_count = not_bltin_count + 1
End If
Next
Debug.Print "Builtin= " & bltin_count & ", NotBuiltin= " & not_bltin_count
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment