ChartObject

LDale

New Member
Joined
Apr 2, 2011
Messages
26
I'm currently using the following code but it is only when create the first chart. I need it to be dynamic. <o:p></o:p>
ActiveSheet.ChartObjects("Chart 1").Activate <o:p></o:p>
<o:p> </o:p>
I also have tried the following but they don't work either.<o:p></o:p>
<o:p> </o:p>
ActiveSheet.ChartObjects("Chart " & NC).Activate<o:p></o:p>
ActiveSheet.ChartObjects("Chart " & chartno).Activate <o:p></o:p>
<o:p> </o:p>
Could use some help.<o:p></o:p>
Thank you.<o:p></o:p>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Which chart are you trying to activate? If one just created by code, post the code.
 
Upvote 0
Each time I go to a different worksheet in the workbook and run the macro it will create a chart on the data for that worksheet. Regardless of how many worksheets I have. I am trying retrieve the chart number that excel assigns to the new chart.
 
Upvote 0
This naming of charts can cause problems.

You could either name the chart as you create it, or use something like this, which will activate the last chart created:

Code:
ActiveSheet.ChartObjects(ActiveSheet.ChartObjects.Count).Activate
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,052
Latest member
Fuddy_Duddy

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