Looking to delete all non-custom styles from a workbook. I cannot find via msdn or other how to point to the parent category. If you expand the Styles on the Ribbon, "Custom" goes at the top, then "Good Bad & Neutral", then "Data & Model", then "Titles & Headings", then "Number Format". I want everything cleared EXCEPT "Custom".
In essence something like:
I've bolded the row in question - again, I used plain language within the code to describe my problem.
Thanks
AS
In essence something like:
Code:
Sub DeleteStyles ()
Dim oStyle as Style
For Each oStyle in ThisWorkbook.Styles
If Not oStyle.ParentCategory = "Custom" Then
oStyle.Delete
End If
Next
End Sub
Thanks
AS