Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User Selectable Series and Number of Series for Line Chart | Charts and Charting in Excel | |||
Varying colors on a line chart with multiple series | Charts and Charting in Excel | |||
Show average line by series on a line chart | Charts and Charting in Excel | |||
Cutting a line in a line chart when data series stops | Charts and Charting in Excel | |||
regarding allocation of chart series point colors | Charts and Charting in Excel |