i wrote some macros to display graphs based on some buttons. But when I click on the second button, a piece of the previous graph appears behind the new graph. How can i avoid this?
This sounds like it's entirely dependent on how the macro is written and what it is doing. Are all the charts built, and macro toggles then on off? Is your macro properly changing the Visible setting on the charts? Is ScreenUpdating being turned on/off properly?
When you delete the rows, it doesn't necessarily delete the shapes/charts that are floating on top of them. It might just shrink the size down to 0, trying to size the chart with the rows. Can you perhaps instead select the chart directly and delete it?