View Single Post
  #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? ;)