use vba to write vba for a chart sheet created on the fly

C

chris_parker_2003

How do I write vba using vba for a chart sheet I have just created on
the fly?
I 've noticed excel gives the vbcomponent a different name to the chart
name which makes it difficult to select the correct vbproject
Thanks
 
K

K Dales

Depends on how you create the chart sheet, but if with the Charts.Add method
then
Dim NewChart as Chart
Set NewChart = Workbooks("WorkbookName").Charts.Add()

Now use the variable NewChart to refer to the chart object, or use its .Name
property if you need that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top