Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
SimSmall
 
Posts: n/a
Default How do I name charts in Excel 2000?

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   Report Post  
Bob Umlas
 
Posts: n/a
Default

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   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recent Documents Disappear (Excel / Office 2000) Ben Holness Excel Discussion (Misc queries) 1 January 14th 05 05:42 PM
How do I update Excel 2000 macros to work in Excel 2002? BobPetrich Excel Discussion (Misc queries) 3 January 4th 05 04:06 PM
Can I add a borders toolbar to Excel 2000 like the one in Excel 2. [email protected] Excel Discussion (Misc queries) 5 January 4th 05 01:58 AM
Excel 2000 running on Windows XP SP2 does not properly open CSV fi Oscar Excel Discussion (Misc queries) 1 December 20th 04 10:10 PM
Statistical Excel Function Question within Excel 2000... Drew H Excel Worksheet Functions 3 October 31st 04 06:55 PM


All times are GMT +1. The time now is 03:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"