B
Bull Splat
I have a workbook with 52 work sheets, and each worksheet has two
charts. I didn't like the legend that Excel made, so I created my own
legend with rectangles (different colors) and text boxes with the
legend information. I created this legend on the first worksheet, and
"planned" to have a macro just select, copy, paste, and place the
legend into each following worksheet.
Well, the macro runs OK, but just once, then the rectangle (a group of
several boxes grouped together) gets a NEW name, Oh Great! SO the
macro bails out.
I've tried giving the legend a name, ("Legend"), then I tried calling
that from the macro, no luck.
And, of someone can tell me how to get the macro to work though all of
the worksheets, it would sure save me a TON of time.
Here,s the code, please help....
Sub Copy_Legend_Chart1()
'
' Copy_Legend_Chart1 Macro
' Macro recorded 02/06/2004 by Default
'
' Keyboard Shortcut: Ctrl+Shift+B
'
Application.Goto Reference:="R90C19"
ActiveSheet.ChartObjects("Chart 1").Activate
'The following line is where it freezes up after one run
ActiveChart.Shapes("Group 26").Select
Selection.Copy
ActiveWindow.Visible = False
ActiveSheet.Next.Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.Paste
Selection.ShapeRange.IncrementLeft 676.99
ActiveWindow.Visible = False
Windows("TimeAudit23-03.xls").Activate
Range("G64").Select
ActiveSheet.Next.Select
End Sub
charts. I didn't like the legend that Excel made, so I created my own
legend with rectangles (different colors) and text boxes with the
legend information. I created this legend on the first worksheet, and
"planned" to have a macro just select, copy, paste, and place the
legend into each following worksheet.
Well, the macro runs OK, but just once, then the rectangle (a group of
several boxes grouped together) gets a NEW name, Oh Great! SO the
macro bails out.
I've tried giving the legend a name, ("Legend"), then I tried calling
that from the macro, no luck.
And, of someone can tell me how to get the macro to work though all of
the worksheets, it would sure save me a TON of time.
Here,s the code, please help....
Sub Copy_Legend_Chart1()
'
' Copy_Legend_Chart1 Macro
' Macro recorded 02/06/2004 by Default
'
' Keyboard Shortcut: Ctrl+Shift+B
'
Application.Goto Reference:="R90C19"
ActiveSheet.ChartObjects("Chart 1").Activate
'The following line is where it freezes up after one run
ActiveChart.Shapes("Group 26").Select
Selection.Copy
ActiveWindow.Visible = False
ActiveSheet.Next.Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveChart.Paste
Selection.ShapeRange.IncrementLeft 676.99
ActiveWindow.Visible = False
Windows("TimeAudit23-03.xls").Activate
Range("G64").Select
ActiveSheet.Next.Select
End Sub