I am trying to examine a whole range of cells.
And depedning on which number the cell has in it, it should have a colouring.
I get a type mismatch error.
It seems like its something wrong with: Select Case Range("T2:AD900").Value
Because of i change to Select Case Range("T2").Value and just test 1 cell it seem to work.
Made some other attempts as well, but then all cells get coloured in the first criteria being met.
Please advice! Thank you for your help.
And depedning on which number the cell has in it, it should have a colouring.
VBA Code:
Select Case Range("T2:AD900").Value
Case 0
ActiveCell.Interior.Color = xlNone
Case 1
ActiveCell.Interior.Color = RGB(255, 153, 0)
Case 2
ActiveCell.Interior.Color = RGB(51, 204, 204)
Case 3
ActiveCell.Interior.Color = RGB(255, 204, 204)
Case 4
ActiveCell.Interior.Color = RGB(255, 255, 153)
Case 5
ActiveCell.Interior.Color = RGB(204, 255, 255)
Case 6
ActiveCell.Interior.Color = RGB(255, 204, 0)
Case 7
ActiveCell.Interior.Color = RGB(192, 192, 192)
Case 8
ActiveCell.Interior.Color = RGB(150, 150, 150)
Case 9
ActiveCell.Interior.Color = RGB(0, 128, 128)
Case 10
ActiveCell.Interior.Color = RGB(205, 204, 255)
Case 14
ActiveCell.Interior.Color = RGB(205, 204, 255)
Case Else
ActiveCell.Interior.Color = RGB(0, 0, 0)
End Select
I get a type mismatch error.
It seems like its something wrong with: Select Case Range("T2:AD900").Value
Because of i change to Select Case Range("T2").Value and just test 1 cell it seem to work.
Made some other attempts as well, but then all cells get coloured in the first criteria being met.
Please advice! Thank you for your help.