squidmark
Board Regular
- Joined
- Aug 1, 2007
- Messages
- 105
I have a macro that compiles data and creates a chart. However, I can't get the chart to format in the same macro. The problem seems to be the chart is given a new name each time the macro creates a new chart, and the macro is looking for a specific chart name, and the name it's looking for DOESN'T change.
So I get this Run-time error: "The item with the specified name wasn't found."
The Macro code the error references is:
ActiveSheet.Shapes("Chart 7").ScaleWidth 1.809895888, msoFalse, _
msoScaleFromBottomRight
Is there a way to assign the chart, each time it is created, the same name every time? And to make sure it's being referenced in the creation and formatting of the chart? There will never be more than one chart in existence -- it starts with a blank worksheet each time.
By the way, the macro was created using he VBA recorder. I can cut and paste and manipulate VBA code a bit, but am just barely learning to write with it, bit by bit.
thanks.
So I get this Run-time error: "The item with the specified name wasn't found."
The Macro code the error references is:
ActiveSheet.Shapes("Chart 7").ScaleWidth 1.809895888, msoFalse, _
msoScaleFromBottomRight
Is there a way to assign the chart, each time it is created, the same name every time? And to make sure it's being referenced in the creation and formatting of the chart? There will never be more than one chart in existence -- it starts with a blank worksheet each time.
By the way, the macro was created using he VBA recorder. I can cut and paste and manipulate VBA code a bit, but am just barely learning to write with it, bit by bit.
thanks.