View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default X values on a chart

Put your category values in (say) G2:H79, eg

wks = 78
wkStart = 22
For i = wkStart To wkStart + wks - 1
Range("G" & 2 + n) = (i - 1) Mod 52 + 1
n = n + 1
Next

and add to the first series in the chart
..XValues = Sheets("Planif-plan").Range("G2:G79")

Regards,
Peter T


"Bobby" wrote in message
...
Could someone give my a hand on this:
I am trying to set a range on a graph but the result does not reflect
the range values.
Here is the code:
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.SeriesCollection.NewSeries
.Values = Sheets("Planif-plan").Range("H2:H79")
End With

I would like to see:
22 23 24 25 26 27 up to 52 and 1 2 3 4 up to 47
This represent 78 weeks of planning

What I get is:
1 to 78
Can this be fix?
Thank you!