Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Update line chart series colors

Hi,

I have a combination bar and line chart. I need to update the chart color based on the color stored at sheet1. However, i just manage to update the bar color but the macro seem not working for the line.

Here is the code

Sub UpdateColours()

Dim MyArray As Range 'The Worksheet with colour selections
Dim MyColour As Object 'object in range
Dim iSeries As Long
Dim rSeries As Range


'YOU MUST CUSTOMISE THIS NEXT SECTION: CHECK THE CH AND TBL SHEET NAMES

Set MyArray = Sheets("Sheet1").Range("L2:L20")

Application.ScreenUpdating = False

With ActiveChart

Do While k < .SeriesCollection.Count
k = k + 1

For Each MyColour In MyArray
If .SeriesCollection(k).Name = "VOL - " & MyColour Then

.SeriesCollection(k).Interior.Color = MyColour.Interior.Color

ElseIf .SeriesCollection(k).Name = "AVG - " & MyColor Then
.SeriesCollection(k).Interior.Color = MyColour.Interior.Color


End If
Next
Loop
End With


Application.ScreenUpdating = True

End Sub

Last edited by Apple Ling : November 2nd 10 at 06:50 AM
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
User Selectable Series and Number of Series for Line Chart Dave in NJ Charts and Charting in Excel 2 February 23rd 09 12:18 AM
Varying colors on a line chart with multiple series LKP Charts and Charting in Excel 2 September 17th 08 03:23 PM
Show average line by series on a line chart Judy Rose Charts and Charting in Excel 1 August 28th 08 04:42 PM
Cutting a line in a line chart when data series stops DannyS Charts and Charting in Excel 2 August 28th 07 10:38 AM
regarding allocation of chart series point colors David Charts and Charting in Excel 2 October 27th 06 09:18 AM


All times are GMT +1. The time now is 06:49 AM.

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"