I have the code below and just need to work it in correct way
this table below has the colour code in RGB it should fill the colour with respect to RGB , if the cell value is above 70 then RGB colour fill should be (0,176,80) and so on.
any help
this table below has the colour code in RGB it should fill the colour with respect to RGB , if the cell value is above 70 then RGB colour fill should be (0,176,80) and so on.
any help
1 | 109.43 | RGB | 0,176,80 | Green color | > 70 | |
2 | 105.826 | RGB | 146,208,80 | light green | >55 - <=70 | |
3 | 103.195 | RGB | 255,0,0 | Red | <55 | |
5 | 83.479 | |||||
6 | 105.624 | |||||
7 | 47.382 | |||||
8 | 104.02 | |||||
9 | 111.292 | |||||
10 | 61.826 | |||||
11 | 97.132 | |||||
12 | 109.231 | |||||
13 | 66.869 | |||||
14 | 175.715 |
VBA Code:
Sub fillcolor()
For I = 1 To 15
a = Sheet1.Cells(I + 1, 2) / 71 * 255
c = Sheet1.Cells(I + 1, 2) / 70 * 255
b = Sheet1.Cells(I + 1, 2) / 55 * 255
Sheet1.Shapes.Range(Array("Freeform " & I + 1)).Fill.ForeColor.RGB = RGB(a, c, b)
Next I
End Sub