I have written the following code which is basically supposed colour some boxes accordingly. Whenever i run this code, it runs the first case i.e. even when some other case
Lots of redundant code you can get rid of and as mentioned a couple of times go with select case.
Try:
Sub Macro_quaterly()
Dim rCell As Range
Select Case Sheet2.Range("B6").Value
Case 1, 2, 3
Set rCell = Range("D7")
Sheet2.Cells(6, 11) = "rrrrrrr"
Case 4, 5, 6, 7
Set rCell = Range("D7:E7")
Sheet2.Cells(6, 12) = "rffffdffffdr"
Case 8, 9, 10, 11
Set rCell = Range("D7:F7")
Case Else
End Select
With rCell.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Set rCell = Nothing
End Sub