55楼:
Sub 返回指定单元条件格式公式()
Range("A2") = Range("A1").FormatConditions(1).Formula1
End Sub
也可用于筛选 介于,不介于
row2 = 14
col2 = 6
Cells(1, 2) = Cells(row2 + k, col2).FormatConditions(1).Formula1
Cells(1, 3) = Cells(row2 + k, col2).FormatConditions(2).Formula2
Cells(1, 2) = Cells(1, 2).Value
Cells(1, 3) = Cells(1, 3).Value
For k = 0 To 27
Cells(row2 + k, col2).Select
If Cells(row2 + k, col2) <= Cells(1, 2) Or Cells(row2 + k, col2) >= Cells(1, 3) Then
Cells(1, 1) = 3
End If
Cells(1, 2) = Null
Cells(1, 3) = Null
Next |