2002 excel microsoft training - vba pivot chart colours
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum 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

resolvedResolved · Low Priority · Version Standard

replyReply Fri 14 Dec 2007, 16:11Delegate Zohra said...

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?

For upcoming training course dates see: Pricing & availability

replyReply Fri 4 Jan 2008, 11:36 Edited on Fri 4 Jan 2008, 11:37Trainer Stephen said...

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

 


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard