Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 134
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3,346
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Hi,

Of course there are only 56 colors on the 2003 pallette to which the
ColorIndex applies.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bob Barnes" wrote:

Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 134
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

But, there are only 6 Colors being used...

Dark Blue = 41
Dark Green = 4
White = -4142
Light Yellow = 6
Dark Red = 3

Your thoughts? TIA - Bob

"Shane Devenshire" wrote:

Hi,

Of course there are only 56 colors on the 2003 pallette to which the
ColorIndex applies.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bob Barnes" wrote:

Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 5,600
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

I'm not sure what the problem is or what you are asking. However it seems to
relate to what colorindex is applied after the 56th series. Briefly, the
'automatic' colours for series start with 17 (or 25) and are applied
sequentially, at 56 they roll over to 1. However after every 56th series a
different grey pattern is applied giving the visual effect of a new set of
56 colours. To prevent patterns after the 56th, apply .pattern = 1.

More here
http://tinyurl.com/nmozvo

Regards,
Peter T


"Bob Barnes" wrote in message
...
Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub



  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 134
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Shouldn't this code...

Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If

Find the color from...
..SeriesCollection(iSeries).Interior.ColorIndex

....and apply it to..
rSeries.Interior.ColorIndex

Or...does the 56th one start..."at 56 they roll over to 1."

Will read your example - thank you - Bob

"Peter T" wrote:

I'm not sure what the problem is or what you are asking. However it seems to
relate to what colorindex is applied after the 56th series. Briefly, the
'automatic' colours for series start with 17 (or 25) and are applied
sequentially, at 56 they roll over to 1. However after every 56th series a
different grey pattern is applied giving the visual effect of a new set of
56 colours. To prevent patterns after the 56th, apply .pattern = 1.

More here
http://tinyurl.com/nmozvo

Regards,
Peter T


"Bob Barnes" wrote in message
...
Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub






  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 134
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Peter T - thank you. I opened the reference.

How can I modify my code, w/ yours...?

My code...
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With

Your code....
For Each sr In chts.SeriesCollection
with sr.Interior
.pattern = 1
.ColorIndex = 23
end with
Next sr

Also, what would be the Dim for the "sr".

TIA - Bob





"Peter T" wrote:

I'm not sure what the problem is or what you are asking. However it seems to
relate to what colorindex is applied after the 56th series. Briefly, the
'automatic' colours for series start with 17 (or 25) and are applied
sequentially, at 56 they roll over to 1. However after every 56th series a
different grey pattern is applied giving the visual effect of a new set of
56 colours. To prevent patterns after the 56th, apply .pattern = 1.

More here
http://tinyurl.com/nmozvo

Regards,
Peter T


"Bob Barnes" wrote in message
...
Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub




  #7   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 5,600
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Afraid I can't follow your code or infer from it what your are trying to do.
Try and explain what you are trying to do without code, but give details.

For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)


Also, what would be the Dim for the "sr".


In one of the posts thread there's an entire routine in which sr is fully
declared like this
Dim sr As Series

In the posts only snippets of code are shown, however 'sr' as an object
variable is generally, if not always, declared As Series. In context with
'For Each sr In chts.SeriesCollection' it can only be a Series
object,(personally I wouldn't have used 'chts' to refer to a single chart).

Regards,
Peter T


"Bob Barnes" wrote in message
...
Peter T - thank you. I opened the reference.

How can I modify my code, w/ yours...?

My code...
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With

Your code....
For Each sr In chts.SeriesCollection
with sr.Interior
.pattern = 1
.ColorIndex = 23
end with
Next sr

Also, what would be the Dim for the "sr".

TIA - Bob





"Peter T" wrote:

I'm not sure what the problem is or what you are asking. However it seems
to
relate to what colorindex is applied after the 56th series. Briefly, the
'automatic' colours for series start with 17 (or 25) and are applied
sequentially, at 56 they roll over to 1. However after every 56th series
a
different grey pattern is applied giving the visual effect of a new set
of
56 colours. To prevent patterns after the 56th, apply .pattern = 1.

More here
http://tinyurl.com/nmozvo

Regards,
Peter T


"Bob Barnes" wrote in message
...
Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub






  #8   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 134
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Thank you - Bob

"Peter T" wrote:

Afraid I can't follow your code or infer from it what your are trying to do.
Try and explain what you are trying to do without code, but give details.

For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)


Also, what would be the Dim for the "sr".


In one of the posts thread there's an entire routine in which sr is fully
declared like this
Dim sr As Series

In the posts only snippets of code are shown, however 'sr' as an object
variable is generally, if not always, declared As Series. In context with
'For Each sr In chts.SeriesCollection' it can only be a Series
object,(personally I wouldn't have used 'chts' to refer to a single chart).

Regards,
Peter T


"Bob Barnes" wrote in message
...
Peter T - thank you. I opened the reference.

How can I modify my code, w/ yours...?

My code...
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With

Your code....
For Each sr In chts.SeriesCollection
with sr.Interior
.pattern = 1
.ColorIndex = 23
end with
Next sr

Also, what would be the Dim for the "sr".

TIA - Bob





"Peter T" wrote:

I'm not sure what the problem is or what you are asking. However it seems
to
relate to what colorindex is applied after the 56th series. Briefly, the
'automatic' colours for series start with 17 (or 25) and are applied
sequentially, at 56 they roll over to 1. However after every 56th series
a
different grey pattern is applied giving the visual effect of a new set
of
56 colours. To prevent patterns after the 56th, apply .pattern = 1.

More here
http://tinyurl.com/nmozvo

Regards,
Peter T


"Bob Barnes" wrote in message
...
Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub







  #9   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

-4142 is not white, it's default. Which color index values are applied to
the cells in your range? Which are applied to the series?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Bob Barnes" wrote in message
...
But, there are only 6 Colors being used...

Dark Blue = 41
Dark Green = 4
White = -4142
Light Yellow = 6
Dark Red = 3

Your thoughts? TIA - Bob

"Shane Devenshire" wrote:

Hi,

Of course there are only 56 colors on the 2003 pallette to which the
ColorIndex applies.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bob Barnes" wrote:

Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub



  #10   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Try this:

Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
With .SeriesCollection(iSeries).Interior
.ColorIndex = rSeries.Interior.ColorIndex
.Pattern = 1
End With
End If
Next
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______



"Bob Barnes" wrote in message
...
Peter T - thank you. I opened the reference.

How can I modify my code, w/ yours...?

My code...
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With

Your code....
For Each sr In chts.SeriesCollection
with sr.Interior
.pattern = 1
.ColorIndex = 23
end with
Next sr

Also, what would be the Dim for the "sr".

TIA - Bob





"Peter T" wrote:

I'm not sure what the problem is or what you are asking. However it seems
to
relate to what colorindex is applied after the 56th series. Briefly, the
'automatic' colours for series start with 17 (or 25) and are applied
sequentially, at 56 they roll over to 1. However after every 56th series
a
different grey pattern is applied giving the visual effect of a new set
of
56 colours. To prevent patterns after the 56th, apply .pattern = 1.

More here
http://tinyurl.com/nmozvo

Regards,
Peter T


"Bob Barnes" wrote in message
...
Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub








  #11   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 134
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Thank you Jon

"Jon Peltier" wrote:

Try this:

Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
With .SeriesCollection(iSeries).Interior
.ColorIndex = rSeries.Interior.ColorIndex
.Pattern = 1
End With
End If
Next
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______



"Bob Barnes" wrote in message
...
Peter T - thank you. I opened the reference.

How can I modify my code, w/ yours...?

My code...
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With

Your code....
For Each sr In chts.SeriesCollection
with sr.Interior
.pattern = 1
.ColorIndex = 23
end with
Next sr

Also, what would be the Dim for the "sr".

TIA - Bob





"Peter T" wrote:

I'm not sure what the problem is or what you are asking. However it seems
to
relate to what colorindex is applied after the 56th series. Briefly, the
'automatic' colours for series start with 17 (or 25) and are applied
sequentially, at 56 they roll over to 1. However after every 56th series
a
different grey pattern is applied giving the visual effect of a new set
of
56 colours. To prevent patterns after the 56th, apply .pattern = 1.

More here
http://tinyurl.com/nmozvo

Regards,
Peter T


"Bob Barnes" wrote in message
...
Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
End Sub







  #12   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 134
Default SeriesCollection - Incorrect ColorIndex Assigned to Chart

Jon - Thank you.

These are the colors being used...

Dark Blue = 41
Dark Green = 4
White = -4142
Light Yellow = 6
Dark Red = 3

You're correct...the -4142 is th normal color of an Excel Cell, which
happens to look like )is technically ?) white.


"Jon Peltier" wrote:

-4142 is not white, it's default. Which color index values are applied to
the cells in your range? Which are applied to the series?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


"Bob Barnes" wrote in message
...
But, there are only 6 Colors being used...

Dark Blue = 41
Dark Green = 4
White = -4142
Light Yellow = 6
Dark Red = 3

Your thoughts? TIA - Bob

"Shane Devenshire" wrote:

Hi,

Of course there are only 56 colors on the 2003 pallette to which the
ColorIndex applies.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Bob Barnes" wrote:

Has anyone encountered this? TIA - Bob

Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range
Set rPatterns = ActiveSheet.Range("A1:H66")
With ActiveSheet.ChartObjects("Chart 1").Chart
For iSeries = 1 To .SeriesCollection.Count
Set rSeries = rPatterns.Find(What:=.SeriesCollection(iSeries).Na me)
If Not rSeries Is Nothing Then
'Gets near end of the SeriesCollection (56th of 66) & doesn't assign
correct
'ColorIndex
.SeriesCollection(iSeries).Interior.ColorIndex =
rSeries.Interior.ColorIndex
End If
Next
End With
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
Excel Chart SeriesCollection Formula sgpl Excel Discussion (Misc queries) 1 February 19th 09 05:21 PM
Pie Chart Percentage incorrect Bryan in Bakersfield Charts and Charting in Excel 8 October 11th 07 08:21 PM
Chart: range info from seriescollection? Excelerate-nl Charts and Charting in Excel 1 May 24th 06 04:37 AM
How do re-order values assigned by Excel for chart data? suezylogan Charts and Charting in Excel 3 March 14th 06 04:49 PM
colorIndex listing for Chart with autoformat settings Jean Ruch Charts and Charting in Excel 2 October 14th 05 08:55 AM


All times are GMT +1. The time now is 11:41 PM.

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

About Us

"It's about Microsoft Excel"