Hi,
Below is the code I recorded to draw a graph based on a fixed range of data that is not contiguous. I would like the graph to be drawn using the same start points for each series range, but with a varying number of rows.
The data is always in these columns - B,D, F and I and will always start at row 37, but may stop at any point rather than the row 59 in the example.
Range("B37:B59,F37:F59,D3759,I37:I59").Select
Range("I37").Activate
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Cost to Connect by Creative").Range _
("B37:B59,D3759,F37:F59,I37:I59"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:= _
"Cost to Connect by Creative"
ActiveChart.SeriesCollection(2).Select
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).ChartType = xlColumnClustered
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).AxisGroup = 1
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).AxisGroup = 2
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).ChartType = xlLineMarkers
ActiveChart.SeriesCollection(3).Select
ActiveChart.SeriesCollection(3).ChartType = xlLineMarkers
End Sub
If anyone is able to assist with entering a range it would be greatly appreciated. I have tried named ranges but without any joy - should I still use a named range?
Thank you for your time and any assistance.
Below is the code I recorded to draw a graph based on a fixed range of data that is not contiguous. I would like the graph to be drawn using the same start points for each series range, but with a varying number of rows.
The data is always in these columns - B,D, F and I and will always start at row 37, but may stop at any point rather than the row 59 in the example.
Range("B37:B59,F37:F59,D3759,I37:I59").Select
Range("I37").Activate
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Cost to Connect by Creative").Range _
("B37:B59,D3759,F37:F59,I37:I59"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:= _
"Cost to Connect by Creative"
ActiveChart.SeriesCollection(2).Select
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).ChartType = xlColumnClustered
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).AxisGroup = 1
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).AxisGroup = 2
ActiveChart.SeriesCollection(2).Select
ActiveChart.SeriesCollection(2).ChartType = xlLineMarkers
ActiveChart.SeriesCollection(3).Select
ActiveChart.SeriesCollection(3).ChartType = xlLineMarkers
End Sub
If anyone is able to assist with entering a range it would be greatly appreciated. I have tried named ranges but without any joy - should I still use a named range?
Thank you for your time and any assistance.