Zohra has attended:
Excel Advanced course
Excel Intermediate course
Excel VBA Intro Intermediate course
Naming Charts Created by a Macro
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
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 stl-training.co.uk 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