Hey.
So I am using this code as a macro in excel to colour the mentioned cell when the value of b9 is in the appropriate level range.
However it is not colouring the proper cells, it seems to be colouring only B11
So the levels are
0-18.49 color cell B11
18.5 - 24.9 color cell B12
25 - 29.9 color cell B13
30- 100 color cell B14
here is the code
Sub AssignmentQuestion4()
If B9 < 18.49 Then
Range("B11").Select
With Selection.Interior
.Color = 655
End With
End If
If 18.5 < B9 And B9 < 24.9 Then
Range("B12").Select
With Selection.Interior
.Color = 655
End With
End If
If Formula = 25 < B9 And Formula < 29.9 Then
Range("B13").Select
With Selection.Interior
.Color = 655
End With
End If
If Formula = B9 > 30 Then
Range("B14").Select
With Selection.Interior
.Color = 655
End With
End If
End Sub
I apologize if this is not allowed, I am new to the boards and new to VB, and would very much appreciate any help.
So I am using this code as a macro in excel to colour the mentioned cell when the value of b9 is in the appropriate level range.
However it is not colouring the proper cells, it seems to be colouring only B11
So the levels are
0-18.49 color cell B11
18.5 - 24.9 color cell B12
25 - 29.9 color cell B13
30- 100 color cell B14
here is the code
Sub AssignmentQuestion4()
If B9 < 18.49 Then
Range("B11").Select
With Selection.Interior
.Color = 655
End With
End If
If 18.5 < B9 And B9 < 24.9 Then
Range("B12").Select
With Selection.Interior
.Color = 655
End With
End If
If Formula = 25 < B9 And Formula < 29.9 Then
Range("B13").Select
With Selection.Interior
.Color = 655
End With
End If
If Formula = B9 > 30 Then
Range("B14").Select
With Selection.Interior
.Color = 655
End With
End If
End Sub
I apologize if this is not allowed, I am new to the boards and new to VB, and would very much appreciate any help.