Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Charts Formatting
Charts Formatting
Resolved · Low Priority · Version 2003
Charts Formatting
when trying to change colors of seriescollections is it possible to dynamically determine the number of sereis collections to avoid trying to change a collection that does not exist?For upcoming training course dates see: Pricing & availability
RE: Charts Formatting
Hi PeterThanks for your question
As discussed I will generate the code required to do this and then post it to this thread. I will do this within the next few days
Regards
Stephen
RE: Charts Formatting
Hi PeterSorry for the delay in responding
The trick is to use the count method of the seriescollection object. The following code demos this by assigning it to a variable and presenting it in a message box.
Sub ChartsSeries()
On Error Resume Next
Dim aChart As Chart
Dim SeriesCount As Integer
Set aChart = Charts.Add
With aChart
.SetSourceData Sheets(1).Range("A1:D4"), xlColumns
SeriesCount = .SeriesCollection.Count
MsgBox SeriesCount
End With
End SubHope this is useful,please follow up if you have any further questions
Regards
Stephen
|
|
» Forum post: Charts |



Course updates

