|
我用的是WPS表格,用下面这段语句,就会引起WPS表格自带的查批功能失效。
----------------------------------
Sub 清除带底色()
Dim c As Range, rng As Range, firstAddress$, m&, d As Object, shp As Shape
Set d = CreateObject("scripting.dictionary")
With Application.FindFormat
.Clear
.Interior.Color = RGB(221, 235, 247)
End With
With ActiveSheet.UsedRange
Set c = .Find(What:="", SearchFormat:=True)
If Not c Is Nothing Then
firstAddress = c.Address
Do
m = m + 1
If m > 1 Then Set rng = Union(rng, c.MergeArea) Else Set rng = c.MergeArea
d(c.Address) = ""
Set c = .Find(What:="", After:=c, SearchFormat:=True)
Loop While Not c Is Nothing And firstAddress <> c.Address
End If
End With
|
|