|
Forum home »
Delegate support and help forum »
Microsoft Excel Training and help » advanced excel course london - Naming Charts Created by a Macro
advanced excel course london - Naming Charts Created by a Macro
The UK's most regular instructor-led training courses.
Training information: advanced excel course london
· Excel training courses
· Microsoft Excel Training London See also
· excel-courses-london
· excel courses in london
· excel microsoft training Resolved · Low Priority · Version Standard
Naming Charts Created by a Macro
by - delegate Zohra [10 posts] (2007 Aug 14 Tue, 16:49) Reply
Hello,
I've set up a macro to create a couple of charts. I'd like the end of the macro to resize the graphs and have done this by recording another macro. However, I can't seem to get the end to refer to the right chart object- is there a way of naming the chart so that I can use
ActiveSheet.Shapes("Chart Name").IncrementTop XX
?
RE: Naming Charts Created by a Macro
by - delegate Zohra [10 posts] (2007 Aug 14 Tue, 17:18) Reply
Adding in an example of where it goe swrong:
ActiveChart.Name = "Chart 13"
'at this point the chart is named "Chart 13"
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
'at this point it changes and the next line produces an error
ActiveChart.Name = "Chart 13"
RE: Naming Charts Created by a Macro
Zohra
i think that you may need to reselect the chart ie
use Charts("Chart 13").Select
instead of the line ActiveChart.Name = "Chart 13".
If that doesn't work you could send the spreadsheet where the error occurs to
info AT microsofttraining.net and mark it to the attention of Carlos
I'll have a look at how the code is working and hopefully come up with an answer.
Regards
Carlos
|