Hi Rory
The code above does not work....could you please give it another try?
Thanks
Main Topics
Browse All TopicsHi
How do I delete two charts both located to in a new sheet?They will always be to the left of a specific sheet eg "Macro Sheet". How can I use this as a reference to delete these chart sheets??
Thanks
Khoi
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
sorry but the code does not work...let me explain a bit more clearly.
I have a macro that generates two charts...they are located in sheet "chart1" and "chart2" respectively (so not as a chart in the "macro" sheet itself). I basically want these sheets to be deleted the next time I run the macro as another 2 new charts will be produced.
Thanks
Thing is the sheets next to the "Macro Sheet" will be called something different each time, so it complicates things a bit.
What is the code to simply just delete the two sheets (or just one sheet and I will just repeat the line) next to the "MacroSheet"?I tried to do a macro record but it comes up with a box asking if you are sure if you want to delete it.
Thanks
Ybui
As originally written, the code will delete the two sheets to the left of the macro sheet, if they are both chart sheets. It would not error as it has an error handler. The only situation I can think of that it wouldn't handle would be if the sheet immediately to the left is not a chart sheet - then it won't delete anything.
Business Accounts
Answer for Membership
by: roryaPosted on 2009-11-05 at 04:43:38ID: 25748799
Try this:
Select allOpen in new window