Hi Guys, Im creating a macro which highlights a cell based on its value, i have figured it out how to do it for tables, however, I was wondering if there is a way for me to select all the cells which contain percentages and loop through them and conditionally color them?
I have this so far
in this example, i want to color all the cells in green under the column KRI which are less than or equal to 10%, i have the pivot table in tabular form.
any and all help would be greatly appreciated.
I have this so far
Code:
Dim cl As Range Dim pt As PivotTable
Set pt = ActiveSheet.PivotTables(1)
Range(pt.PivotFields("KRI").DataRange).Select
For Each cl In Range(pt.PivotFields("KRI").DataRange)
If cl <= 0.1 Then
cl.Interior.Color = 5287936
cl.Font.ColorIndex = 2
End If
Next cl
in this example, i want to color all the cells in green under the column KRI which are less than or equal to 10%, i have the pivot table in tabular form.
any and all help would be greatly appreciated.