Showing posts with label styles. Show all posts
Showing posts with label styles. Show all posts

Thursday, May 7, 2015

Cleaning Excel Styles

The code below will clean the Excel styles:

Sub StyleKiller()
    Dim styT As Style
    Dim intRet As Integer

    For Each styT In ActiveWorkbook.Styles
        If Not styT.BuiltIn Then
            'intRet = MsgBox("Delete style '" & styT.Name & "'?", vbYesNo)
            'If intRet = vbYes Then styT.Delete
            styT.Delete
        End If
    Next styT
End Sub