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

  • Thread starter Thread starter chris_parker_2003
  • Start date Start date
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
 
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

Back
Top