
Up to now Microsoft has not considered the business impact high enough to provide this fix. The best solution would be to prevent the pasting of unused cell styles, but requires Microsoft to fix a bug in Excel 2007 and later. If st_array(i_y) = stylename Then Check_Array = True If st_array(i_y) = stylename Then Delete_Styles = Falseįunction Check_Array(stylename As String) As Boolean Option Explicitįunction Delete_Styles(stylename As String) As Boolean


The macro was provided by the Microsoft Office Support. It is similar to the macro above, however it may take very long to run. Remove_Styles() removes only unused custom cell styles from your workbook. MsgBox "Styles deleted: " & i_cust & " styles" & Chr(13) & "Styles left: " & Sub DeleteCustomStyles()įor i = () To 1 Step -1 Then paste one of the following macros and run it by pressing F5:ĭeleteCustomStyles() removes all custom cell styles from your workbook.

Select your workbook and click on Insert → Module.
