Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default REformatting PivotChart

Mike -

Does the BP series have any data in it? If it's all blank, you won't be
able to select it.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Mike Collard wrote:
I have a PivotChart that needs reformating each time it is
refreshed - the number of data series changes depending on
the selection so I have the code below to apply the
appropriate format. However, I get a runtime error 1004
Method 'SeriesCollection' of object '_Chart failed when
certain series are present i.e. it works sometimes and not
others.

Very grateful for any help.


Mike Collard


Sub Reformat()

Dim iSrsCt As Integer, iSrsIx As Integer

iSrsCt = ActiveChart.SeriesCollection.Count

Application.ScreenUpdating = False

For iSrsIx = 1 To iSrsCt

Select Case ActiveChart.SeriesCollection(iSrsIx).Name

Case "BP"
ActiveChart.SeriesCollection(iSrsCx).Select ERROR HERE
With Selection.Border
.ColorIndex = 4
.Weight = xlMedium
.LineStyle = xlContinuous
End With

Case "ESSO"
ActiveChart.SeriesCollection(iSrsIx).Select
With Selection.Border
.ColorIndex = 1
.Weight = xlMedium
.LineStyle = xlContinuous
End With

End Select
Next

End sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default REformatting PivotChart

This may be a stupid question, but....
on your line:
ActiveChart.SeriesCollection(iSrsCx).Select ERROR HERE

Do you mean to have iSrsCx or iSrsIx.... just asking cuz you didn't
dim it and you dimmed everything else.



On Fri, 08 Aug 2003 00:24:48 -0400, Jon Peltier
wrote:

Mike -

Does the BP series have any data in it? If it's all blank, you won't be
able to select it.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Mike Collard wrote:
I have a PivotChart that needs reformating each time it is
refreshed - the number of data series changes depending on
the selection so I have the code below to apply the
appropriate format. However, I get a runtime error 1004
Method 'SeriesCollection' of object '_Chart failed when
certain series are present i.e. it works sometimes and not
others.

Very grateful for any help.


Mike Collard


Sub Reformat()

Dim iSrsCt As Integer, iSrsIx As Integer

iSrsCt = ActiveChart.SeriesCollection.Count

Application.ScreenUpdating = False

For iSrsIx = 1 To iSrsCt

Select Case ActiveChart.SeriesCollection(iSrsIx).Name

Case "BP"
ActiveChart.SeriesCollection(iSrsCx).Select ERROR HERE
With Selection.Border
.ColorIndex = 4
.Weight = xlMedium
.LineStyle = xlContinuous
End With

Case "ESSO"
ActiveChart.SeriesCollection(iSrsIx).Select
With Selection.Border
.ColorIndex = 1
.Weight = xlMedium
.LineStyle = xlContinuous
End With

End Select
Next

End sub


Reply
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
Reformatting ILoveMyCorgi Excel Discussion (Misc queries) 5 January 12th 10 06:42 AM
Help With Reformatting Robert Excel Discussion (Misc queries) 0 July 23rd 09 02:56 PM
Duplicating PivotChart / Changing PivotChart data range BillG Charts and Charting in Excel 0 February 4th 09 08:56 PM
Reformatting a column Janna Excel Discussion (Misc queries) 4 September 14th 06 03:41 AM
Reformatting numbers skacleve Excel Discussion (Misc queries) 1 December 29th 05 06:03 PM


All times are GMT +1. The time now is 09:43 AM.

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"