Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi all,
I'm doing some IT coursework and have a macro that creates a chart from some data in a worksheet. All works well until you run the macro again - now it says the chart doesn't exist... I've sinced looked at it in visual basic, the highlighted line says to select "Chart 22" my guess is that every time I run this macro it gets bigger by one, but even so, it now has the wrong name, and the macro crashes :'( Anyone know how I can set each newly created chart to be called "Chart 22" or whatever else I tell it to look for? Please? ;) |
#2
![]() |
|||
|
|||
![]()
If you're always referring to the last chart created, you can use something
like set Mychart = activesheet.chartobjects(activesheet.chartobjects. count) Bob Umlas Excel MVP I'm leading a FREE 1-hour online Webinar on Excel Tips & Tricks. May 12 from 4-5PM, and again June 15, 4-5PM. If interested, go to http://www.iil.com, click on the yellow/orange "Try a free webinar" link on the left side, click the Microsoft Excel Tips & Tricks link, follow instructions to register. "SimSmall" wrote in message ... Hi all, I'm doing some IT coursework and have a macro that creates a chart from some data in a worksheet. All works well until you run the macro again - now it says the chart doesn't exist... I've sinced looked at it in visual basic, the highlighted line says to select "Chart 22" my guess is that every time I run this macro it gets bigger by one, but even so, it now has the wrong name, and the macro crashes :'( Anyone know how I can set each newly created chart to be called "Chart 22" or whatever else I tell it to look for? Please? ;) |
#3
![]() |
|||
|
|||
![]()
Jon Peltier has some sample code for creating charts. It may help you
adjust your own code: http://www.peltiertech.com/Excel/Cha...kChartVBA.html SimSmall wrote: Hi all, I'm doing some IT coursework and have a macro that creates a chart from some data in a worksheet. All works well until you run the macro again - now it says the chart doesn't exist... I've sinced looked at it in visual basic, the highlighted line says to select "Chart 22" my guess is that every time I run this macro it gets bigger by one, but even so, it now has the wrong name, and the macro crashes :'( Anyone know how I can set each newly created chart to be called "Chart 22" or whatever else I tell it to look for? Please? ;) -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Recent Documents Disappear (Excel / Office 2000) | Excel Discussion (Misc queries) | |||
How do I update Excel 2000 macros to work in Excel 2002? | Excel Discussion (Misc queries) | |||
Can I add a borders toolbar to Excel 2000 like the one in Excel 2. | Excel Discussion (Misc queries) | |||
Excel 2000 running on Windows XP SP2 does not properly open CSV fi | Excel Discussion (Misc queries) | |||
Statistical Excel Function Question within Excel 2000... | Excel Worksheet Functions |