bltseattle
Civil/Environmental
- Sep 18, 2002
- 347
I am somewhat new to VBA and feel that this should be simple, but I'm stumped. I want a macro that will copy a chart from sheet A to sheet B, then resize the chart. Essentially mirroring the chart from A to B.
The source data is the same each time I use the sheet (or else this would be a no-brainer), and the original chart is prepared by pasting the data series (depending on which one the user picks) into the formatted chart area.
The macro works fine to copy and paste the chart, but it crashes on the resizing part. The problem seems to be that the name of the chart is different each time, so if it is "Chart 9" when I recorded the macro it is some different number such as "Chart 11" after I've performed the procedure several times. This crashes the macro.
What code would let me copy, paste, then select the new chart? (I can get the resizing part of the code from my recorded macro, if it would only pick the correct chart!)
The source data is the same each time I use the sheet (or else this would be a no-brainer), and the original chart is prepared by pasting the data series (depending on which one the user picks) into the formatted chart area.
The macro works fine to copy and paste the chart, but it crashes on the resizing part. The problem seems to be that the name of the chart is different each time, so if it is "Chart 9" when I recorded the macro it is some different number such as "Chart 11" after I've performed the procedure several times. This crashes the macro.
What code would let me copy, paste, then select the new chart? (I can get the resizing part of the code from my recorded macro, if it would only pick the correct chart!)