Excel VBA 删除自定义样式宏

Sub Del_YS()
'删除自定义样式
For Each s In ActiveWorkbook.Styles
'MsgBox s.Name
On Error Resume Next
If Len(s.Name) > 0 And s.Name <> "Normal" Then
s.Delete
End If
If Err.Number > 0 Then
e = "Error occour on deleting Style named " & s.Name
e = e & vbCrLf & "Err:" & Err.Number & "->" & Err.Description
MsgBox e
Err.Clear
End If
Next
End Sub

 

添加评论

Loading