Hello,
I have data in columns in each sheet of a workbook.
I would like to set up a xlradar chart on each sheet - with each radar chart having multiple series. The data series are taken from data columns on the respective sheet. Here is my code - I can't seem to get it working:-
can some one explain why pls ? thank you
,
I have data in columns in each sheet of a workbook.
I would like to set up a xlradar chart on each sheet - with each radar chart having multiple series. The data series are taken from data columns on the respective sheet. Here is my code - I can't seem to get it working:-
VBA Code:
Public Sub set_up_graphs()
Dim sh As Long
Dim sheet_name As String
Dim number_of_questions_in_this_category As Long
Dim chart_output_range As Range
Dim series_data_range As Range
Dim series_legend As String
Dim c As Long
Dim r As Long
Set chart_output_range = Range("b2:o16")
For sh = 1 To no_of_categories
sheet_name = automater.Sheets(1).Range("g16").Offset(sh, 0)
number_of_questions_in_this_category = automater.Sheets(1).Range("g16").Offset(sh, 2)
With output_workbook.Sheets(sheet_name).ChartObjects.Add _
(Left:=chart_output_range.Left, Width:=chart_output_range.Width, Top:=chart_output_range.Top, Height:=chart_output_range.Height)
.Chart.ChartType = xlRadar
.Chart.HasTitle = True
.Chart.ChartTitle.Text = sheet_name
.Chart.ChartTitle.Font.Size = 12
End With
For c = 1 To number_of_questions_in_this_category
series_legend = output_workbook.Sheets(sheet_name).Range("o2").Offset(0, c).Value
Set series_data_range = output_workbook.Worksheets(sheet_name).Range("o1").Offset(last_row_of_source_data + 2, c).Resize(5, 1)
With ActiveChart.SeriesCollection.NewSeries
.XValues = series_data_range
.Name = series_legend
End With
Next c
Next sh
End Sub
can some one explain why pls ? thank you
,