Embedded Chart on Worksheet Using Excel Vba
Sponsor
Embedded Chart on Worksheet Using Excel Vba [Q]
Hi, i have an excel button command that brings a embedded chart onto my excel worksheet, it works fine, so i wanted to write a simple excel macro to assign to another macro button to delete the chart when i had finished looking at it, this is what microsoft Excel recorded:
ActiveSheet.ChartObjects(”Chart 5029″).Activate
ActiveChart.Axes(xlValue).Select
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
Selection.Delete
Now this works as long as the “Chart 5029″ number is the same as on the
chart its self ,ie when i left click and put it in an excel chart window to see what the number is along the top of the box, so, i press the button, it works, i
call up a chart again with the other button, press the delete button and
error, because the Chart number as changed to one thats different to the one
in the excel macro. I don’t know what the number is for and how to either stop it from changing ( why does it change ) or to write an excel macro to adjust for the change in this number.
Embedded Chart on Worksheet Using Excel Vba [A]
This excel vba can embed one chart on your excel worksheet, so if you have only one chart on your worksheet use
ActiveSheet.ChartObjects(1).Activate
Rate This Tips:
Incoming excel search terms
mss,excel vba delete chart,vba embedded chart,excel embedded chart,vba delete chart,excel vba delete all charts,excel vba embedded chart,vba chart,,vba add chart to worksheet,vba delete charts,vba embed,excel macro delete chart,vba charts,embedded chart,excel vba activate embedded chart,excel vba chart,vba activate chart,vba excel delete chart,what is an embedded chart in excel,activechart parent delete,delete chart excel vba,delete chart vba,embedded chart excel,embedded chart on excel,embedded chart vba,excel vba activechart,excel vba chart delete,excel vba delete charts,excel vba embedded charts,excel vba select embedded chart,excel worksheet and embedded chart,how do you delete an embedded chart,rename chart vba,vba activechart,vba chart excel,vba chart window,=embed excel vba,activate chart vba,activating a chart in a macro,activating embedded charts on a sheet by name ms excel,activechart excel vba,activechart select using excel vba,an embedded chart is one that is,assign macro to chart in excel,chart vba,charts in one worksheet vba,clear chart based on criteria,clear chart based on criteria using vba,copy embedded chart to excel
Related Excel Tips
Comments
2 Comments on Embedded Chart on Worksheet Using Excel Vba
-
Jon Peltier on
Wed, 29th Apr 2009 12:15 pm
-
vba excel on
Tue, 5th May 2009 4:58 am
What if you have multiple charts and only want to delete the active one?
ActiveChart.Parent.Delete
Or if you know it’s the last chart created?
ActiveSheet.ChartObjects(ActiveSheet.ChartObjects.Count).Delete
thats it, thanks jon..
Have another excel answer or questions for this problem ?
Feel free to post it here..














