Hi all,
I'm working on a spreadsheet that colours cells according to the cells value (as in conditional formatting). I've used VBA to forfill three of the four criteria necessary as follows.
Private Sub Worksheet_Calculate()
Set myrange = Range("c13:c32")
Dim iColor As Integer
Dim cell As Range
For Each cell In myrange
Select Case cell.Value
Case Is < 85 'Red
iColor = 3
Case 85 To 90 'Amber
iColor = 44
Case Is > 90 'Green
iColor = 10
End Select
cell.Interior.ColorIndex = iColor
Next
End Sub
That was simple enough except I'd like one further colour, and the input comes from a different sheet in the same workbook (luckily with the same cell reference) The formatting criteria would be case <20 producing a cell colorindex of 20. Would it be possible to modify the vba script to accomodate this fourth conditional format.
Kind regards,
Moony
Bookmarks