Update multiple chart series & multiple chart with VBA

mts91

New Member
Joined
Jul 4, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Hope you are doing well.

I'm coming on this forum because i really need your help and i'm a big beginner with VBA.

I have 3 charts :

-Chart1
-Chart2
-Chart3

I want to update multiple series ranges on these charts with a one VBA code like below :

Chart 1
-Update "Serie 1" with the range B2:B14
-Update "Serie 2" with the range C4:C12
-Update "Serie 3" with the range D5:C10

Chart 2
-Update "Serie 1" with the range E4:E10
-Update "Serie 2" with the range G3:E10

Series names and Chart names are like above, and the chart and series are already build with all.
I just want to update the series range on these chart, i don't want to modify the series name or the layout of the series.

Do you think someone can help me with this ? As i said i'm starting to use VBA and i'm really blocked with this operation.

Thanks a lot in advance.
 
With the new code, the error occurs at the same line as before.

VBA Code:
CH.SeriesCollection(1).Values = WS.Range("E94:E117")

Can you confirm me that the ChartObjects("Connexion_Graph") is the graph name right ?
I confirm that the graph name is "Connexion_Graph" and the sheet name is "Overview"
 
Upvote 0

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
With the new code, the error occurs at the same line as before.

VBA Code:
CH.SeriesCollection(1).Values = WS.Range("E94:E117")

Can you confirm me that the ChartObjects("Connexion_Graph") is the graph name right ?
I confirm that the graph name is "Connexion_Graph" and the sheet name is "Overview"

I cannot confirm because I have no way of knowing what charts you have or do not have.

These two statements would have executed before the error and printed their results in the VBE 'Immediate' pane. What results did they return?

VBA Code:
Debug.Print "Series count = " & CH.SeriesCollection.Count

VBA Code:
Debug.Print CH.SeriesCollection(1).Formula
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,738
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top