LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Format Data Series in a Pivot Chart

Hello,

I have 2 pivot charts, which both have the same data series, but depending
on the selections made not all the data series will be used.
I have recorded the code below from the macro recorderto format each series
in a particular colour.

But if say "Late" is not in the data selected, it gives me a run time error.

How can I modify the code so that it will look for each data series and if
not found go to the next data series.

Sub FormatSeries ()

Application.ScreenUpdating = False

ActiveChart.PlotArea.Select
With Selection.Border
.ColorIndex = 39
.Weight = xlThin
.LineStyle = xlContinuous
End With
Selection.Fill.OneColorGradient Style:=msoGradientHorizontal,
Variant:=1, _
Degree:=0.231372549019608
With Selection
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = 15
End With




ActiveChart.SeriesCollection("Early").Select

With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 27
.Pattern = xlSolid
End With
ActiveChart.SeriesCollection("Late").Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
ActiveChart.SeriesCollection("OnTime").Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlAutomatic
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With

Application.ScreenUpdating = True



End Sub

Any help/assistance would be greatly appreciated.

Winnie


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Format data series (Chart) KRK New Users to Excel 2 December 26th 09 12:23 PM
Format Data Series in a Chart Jennifer Excel Worksheet Functions 4 May 22nd 07 08:22 PM
Pivot Chart - X,Y & Data Series Options Graham Haslehurst Charts and Charting in Excel 4 November 24th 05 02:51 PM
Format Series in Pivot Chart tobriant[_2_] Excel Programming 1 October 18th 05 01:13 PM
Format Data Series in Pivot Chart tobriant Excel Programming 1 October 18th 05 01:12 PM


All times are GMT +1. The time now is 06:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"