Excel 2010 VBA Excel Chart Name

jjlafond

Board Regular
Joined
Jul 17, 2014
Messages
56
Hello,

I am creating several charts using VBA in Excel 2010, but I need to be able to reNAME the chart so that I can reference it in later lines. However, each time I create a new chart, the Chart is automatically named (Chart 1, Chart 2, Chart 3, Chart 4...) and I have to manually change the name to allow the code to work.

Is there a way to name the chart when creating it without physically looking at the chart name and editing manually?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Maybe try

Code:
ActiveSheet.ChartObjects(ActiveSheet.ChartObjects.Count).Name = "Fred"
 
Upvote 0

Forum statistics

Threads
1,225,208
Messages
6,183,593
Members
453,173
Latest member
Ali4772

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