|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub yanjie()
Dim pt As PivotTable, pf As PivotField, pi As PivotItem, rg As Range, numrg As Range
Set pt = Sheet1.PivotTables(1)
Set pf = pt.ColumnFields(1)
Set numrg = pt.DataBodyRange
Set numrg = numrg.Resize(numrg.Rows.Count - 1, numrg.Columns.Count - 1)
On Error Resume Next '遇到没有"DEAD BOLT"项,会出现错误!
For Each rg In numrg
If rg.PivotCell.ColumnItems(1).Name = "DEAD BOLT" And rg <> 1780 And rg > 0 Then
rg.Interior.ColorIndex = 6
End If
Next rg
End Sub
数据透视表.rar
(23.57 KB, 下载次数: 5)
|
|