I need open a chart to edit, but I can't select it. I made many examples of charts, so I've tried to open one, but it's not working:
Sub editanomeserie()
Charts(1).Select
ActiveChart.SeriesCollection(4).Name = "Nova"
End Sub
Try selecting ChartObjects(1) instead of Chart(1).
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
It's not working either.
With Charts(1).select, error 9
MaybeChartObjects(1).Charts(1).SeriesCollection(4).Name = "Nova"
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
I did this code trying to study something else about this topic.
Now, it's working, thanks.Sub Experience() Dim MyGraf As ChartObject Dim lastcell As Long Debug.Print ActiveChart.Parent.Index Range("A2").Select ActiveSheet.ChartObjects(1).Select Set MyGraf = ActiveSheet.ChartObjects(1) lastcell = MyGraf.Chart.SeriesCollection.Count MyGraf.Chart.SeriesCollection(lastcell).Name = "LastCell" End Sub
It would be
Activesheet.ChartObjects(1).Chart.SeriesCollection(4).Name = "Nova"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks