|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
有隐藏的工作表
Sub 执行()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If IsNumeric(Trim(ws.Name)) Then
ws.Activate
With ws.Range("D6:E37")
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Operator:=-1, Formula1:="=XLOOKUP(D6,'1.楼栋明细表'!$F:$F,'1.楼栋明细表'!$P:$P)='1'!$J$2", Formula2:=""
.FormatConditions(1).Interior.Color = [K2].Value
End With
With ws.Range("D7:E37")
.Select
.FormatConditions.Add Type:=xlExpression, Operator:=-1, Formula1:="=XLOOKUP(D6,'1.楼栋明细表'!$F:$F,'1.楼栋明细表'!$P:$P)='1'!$J$2", Formula2:=""
.FormatConditions(2).Interior.Color = [K2].Value
End With
With ws.Range("G6:H37")
.Select
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Operator:=-1, Formula1:="=XLOOKUP(D6,'1.楼栋明细表'!$F:$F,'1.楼栋明细表'!$P:$P)='1'!$J$2", Formula2:=""
.FormatConditions(1).Interior.Color = [K2].Value
End With
With ws.Range("G7:H37")
.Select
.FormatConditions.Add Type:=xlExpression, Operator:=-1, Formula1:="=XLOOKUP(D6,'1.楼栋明细表'!$F:$F,'1.楼栋明细表'!$P:$P)='1'!$J$2", Formula2:=""
.FormatConditions(2).Interior.Color = [K2].Value
End With
End If
Next ws
End Sub |
评分
-
1
查看全部评分
-
|