This piece of code is trying to change the colour of the chart bars according to the Quarter (four quarters of a year and the same colour for every other quarter)
so my x-axis label is by month and I am trying to search for it and then use the Month() function to get the month number.
Sub chartcolour()
Dim c As Chart
Dim s As Series
Dim iPoint As Long
Dim nPoint As Long
WSChart1.Activate
ActiveSheet.ChartObjects("Chart 3").Activate
Set c = WSChart1.ChartObjects("Chart 3")
Set s = c.SeriesCollection(1)
nPoint = ActiveChart.SeriesCollection(1).Points.Count
For iPoint = 1 To nPoint
If Month(s.XValues(iPoint)) = 11 Or 12 Or 1 Then
s.Points(iPoint).Interior.Color = RGB(153, 153, 255)
ElseIf Month(s.XValues(iPoint)) = 2 Or 3 Or 4 Then
s.Points(iPoint).Interior.Color = RGB(153, 51, 102)
ElseIf Month(s.XValues(iPoint)) = 5 Or 6 Or 7 Then
s.Points(iPoint).Interior.Color = RGB(153, 153, 255)
Else
s.Points(iPoint).Interior.Color = RGB(153, 51, 102)
End If
Next
End Sub