98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » 2002 excel microsoft training - VBA Pivot Chart Colours
2002 excel microsoft training - VBA Pivot Chart Colours
Resolved · Low Priority · Version Standard
Zohra has attended:
Excel Advanced course
Excel Intermediate course
Excel VBA Intro Intermediate course
VBA Pivot Chart Colours
Is there VB code I can write to change the colour of series on a pivot chart?
Further to that, can I then create a loop to run through however many series I have, so that I can change the colours without hard coding how many series I have?
RE: VBA Pivot Chart Colours
Hello Zohra
Thank you for your question
The answer to your question is essentially yes.
You can alter the colour of a series simply by altering the colorIndex property of the series's interior
Typically, this might look something like:-
With Selection.Interior
.ColorIndex = 3
End With
In terms of cycling through series, again this is simple enough. Individual series in a chart are series objects, and belong to the SeriesCollection. This means that it is possible to cycle through each series by using a "For Each Object in SeriesCollection" structure.
If you require further help, could you email a sample chart and worksheet as the details will depensd on the type of chart and data. If this is possible please email it to
infoATmicrosofttrainingDOTnet and mark it for the attention of stephen
Regards
Stephen
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Turn off AutoComplete in ExcelYou may have noticed when typing into your spreadsheets that if you start to enter labels that begin with the same letters as a label that has been previously entered in the same spreadsheet, Excel will try and automatically complete the text for you. This feature is called AutoComplete. |