VBA function to test if cell is conditionally formatted in Excel
问题 I have written the function below to test if a cell has conditional formatting activated based upon the cell fill. Function cfTest(inputCell) If inputCell.DisplayFormat.Interior.Color <> 16777215 Then cfTest = True Else cfTest = False End If End Function It does not work however. Saying that, this method does. Sub myCFtest() Dim R As Integer R = 2 Do If Range("I" & R).DisplayFormat.Interior.Color <> 16777215 Then Range("K" & R).Value = True Else Range("K" & R).Value = False End If R = R + 1