Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 385
Default Multiple charts with same serie names

I want to have the same color in all four of my line charts per series. All
charts have the same series name. Is there some type of VBA code that I can
run a macro to achieve this ?
example:
boat = green line
mnotorcycle = yellow line
auto = red line
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3,346
Default Multiple charts with same serie names

Hi,

You could avoid VBA, maybe, by choosing Tools, Options, Color and setting
the first three colors of the Chart fills aor Chart lines area depending on
the type of charts you are using.
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Jennifer" wrote:

I want to have the same color in all four of my line charts per series. All
charts have the same series name. Is there some type of VBA code that I can
run a macro to achieve this ?
example:
boat = green line
mnotorcycle = yellow line
auto = red line

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 385
Default Multiple charts with same serie names

This will not work I have about 7 series in each chart. I have a macro for
Pie Charts I use to color code the slices according to the label, but this
does not work for the line charts.

"Jennifer" wrote:

I want to have the same color in all four of my line charts per series. All
charts have the same series name. Is there some type of VBA code that I can
run a macro to achieve this ?
example:
boat = green line
mnotorcycle = yellow line
auto = red line

  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 385
Default Multiple charts with same serie names

This is the code I am using to try and consistently color each series in the
four charts I have.
Sub ColorBySeriesName()
Dim rPatterns As Range
Dim iSeries As Long
Dim rSeries As Range

Set rPatterns = ActiveSheet.Range("A1:A10")
With ActiveChart
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
End Sub

I obtain this from Jon Peltier website. The code stops at
.SeriesCollection(iSeries).Interior.ColorIndex = _
rSeries.Interior.ColorIndex

I cannot determine why. All series are identified in a1:a10 and identical to
the series names in my chart data. Any siggestions?



"Shane Devenshire" wrote:

Hi,

You could avoid VBA, maybe, by choosing Tools, Options, Color and setting
the first three colors of the Chart fills aor Chart lines area depending on
the type of charts you are using.
--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Jennifer" wrote:

I want to have the same color in all four of my line charts per series. All
charts have the same series name. Is there some type of VBA code that I can
run a macro to achieve this ?
example:
boat = green line
mnotorcycle = yellow line
auto = red line

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
Using Range Names in Charts Eli Kedar Charts and Charting in Excel 3 October 19th 08 01:57 PM
Charts based on 'virtual' names Lurker Charts and Charting in Excel 2 December 12th 07 09:53 AM
How do I use excel names with INDIRECT with charts Holger Gerths Charts and Charting in Excel 2 July 29th 06 01:25 PM
Assign charts names in VBA? PaulW Excel Discussion (Misc queries) 4 May 11th 06 01:13 PM
Range Names with Charts ArthurJ Charts and Charting in Excel 3 June 6th 05 06:49 PM


All times are GMT +1. The time now is 07:00 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"