Skip to content

Instantly share code, notes, and snippets.

@Neos21

Neos21/Module.bas

Last active May 13, 2019
Embed
What would you like to do?
Excel ブックの不要な名前定義・スタイル定義を削除するマクロ
' 不要な名前を削除
Sub DeleteNames()
On Error Resume Next
Dim n
For Each n In ActiveWorkbook.Names
If InStr(n.Name, "Print_Area") = 0 And InStr(n.Name, "Print_Titles") = 0 And Not n.BuiltIn Then
n.Delete
End If
Next
End Sub
' 不要なスタイルを削除
Sub DeleteStyles()
On Error Resume Next
Dim s
For Each s In ActiveWorkbook.Styles
If Not s.BuiltIn Then
s.Delete
End If
Next
End Sub
@Neos21

This comment has been minimized.

Copy link
Owner Author

@Neos21 Neos21 commented May 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment