2002 excel microsoft training - vba pivot chart colours

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

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

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:

Turn off AutoComplete in Excel

You 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.

If you find this feature more annoying than useful, you can turn it off by:

1. Going to Tools - Options.

2. Select the Edit tab.

3. Remove the tick from next to the "Enable AutoComplete for cell values" option.

4. Click OK.

View all Excel hints and tips


Server loaded in 0.09 secs.