Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

2002 excel microsoft training - vba pivot chart colours

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

ResolvedVersion 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?

Edited on Fri 4 Jan 2008, 11:37

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

Excel tip:

Copying the same value, label or formula quickly into a range of selected cells.

Select your range of cells. Type the value, label or formula that you want to appear in all the selected cells and then press Ctrl+Enter.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.