0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Excelでセルのスタイルを削除するマクロ

Posted at

Excelでセルのスタイルを削除するマクロ

マクロをアドインとして登録する手順

Excelを便利に!アドインの作成

マクロ

デフォルト以外のセルのスタイルを削除する

Sub セルのスタイル削除()
    Dim style As Style
    Dim defaultStyleName As String
    defaultStyleName = "標準" ' 日本語版のExcelでは「標準」、英語版では「Normal」

    For Each style In ActiveWorkbook.Styles
        If style.Name <> defaultStyleName Then
            On Error Resume Next
            style.Delete
            On Error GoTo 0
        End If
    Next style

    MsgBox "カスタムセルスタイルが削除されました。", vbInformation, "完了"
End Sub

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?