M
Michael Hudston
I am using the following Code to plot the chart, but Im not sure how to getit
to let me decide the colours of the Columns it displays
Sub Chrt_Incident_Age_Click()
Dim chtChart As Chart
' Remove Existing Chart
ActiveSheet.ChartObjects.Delete
' Create a new chart.
Set chtChart = Charts.Add
Set chtChart = chtChart.Location(Where:=xlLocationAsObject,
Name:="CHARTS")
With chtChart
.ChartType = xlCylinderCol
' Set data source range.
.SetSourceData Source:=Sheets("BASIC CHART DATA").Range("L11:X14"),
PlotBy:=xlRows
.HasTitle = True
.ChartTitle.Text = "Current Status"
.SeriesCollection(1).XValues = "='BASIC CHART DATA'!$M$4:$X$10"
'.SeriesCollection(1).XValues = "='BASIC CHART DATA'!$M$4:$X$10"
' The Parent property is used to set properties of the Chart.
With .Parent
.Top = Range("G3").Top
.Left = Range("G3").Left
.Width = Range("G3:R30").Width
.Height = Range("G3:R30").Height
End With
End With
ActiveChart.Legend.Select
Selection.Delete
End Sub
I tried the following code that was mentioned on here and it doesnot appear
to do anything. DOes anyone have any ideas?
For i = 1 To ActiveChart.Legend.LegendEntries.Count
ActiveChart.Legend.LegendEntries(i).LegendKey.Select
With Selection.Interior
Select Case i
Case 1
.Color = RGB(0, 51, 153)
Case 2
.Color = RGB(64, 102, 178)
Case 3
.Color = RGB(128, 153, 204)
Case 4
.Color = RGB(102, 102, 255)
Case 5
.Color = RGB(140, 140, 255)
Case 6
.Color = RGB(178, 178, 255)
Case 7
end select
Next
I hope this will help you!!!
Best regards,
Shiva
to let me decide the colours of the Columns it displays
Sub Chrt_Incident_Age_Click()
Dim chtChart As Chart
' Remove Existing Chart
ActiveSheet.ChartObjects.Delete
' Create a new chart.
Set chtChart = Charts.Add
Set chtChart = chtChart.Location(Where:=xlLocationAsObject,
Name:="CHARTS")
With chtChart
.ChartType = xlCylinderCol
' Set data source range.
.SetSourceData Source:=Sheets("BASIC CHART DATA").Range("L11:X14"),
PlotBy:=xlRows
.HasTitle = True
.ChartTitle.Text = "Current Status"
.SeriesCollection(1).XValues = "='BASIC CHART DATA'!$M$4:$X$10"
'.SeriesCollection(1).XValues = "='BASIC CHART DATA'!$M$4:$X$10"
' The Parent property is used to set properties of the Chart.
With .Parent
.Top = Range("G3").Top
.Left = Range("G3").Left
.Width = Range("G3:R30").Width
.Height = Range("G3:R30").Height
End With
End With
ActiveChart.Legend.Select
Selection.Delete
End Sub
I tried the following code that was mentioned on here and it doesnot appear
to do anything. DOes anyone have any ideas?
For i = 1 To ActiveChart.Legend.LegendEntries.Count
ActiveChart.Legend.LegendEntries(i).LegendKey.Select
With Selection.Interior
Select Case i
Case 1
.Color = RGB(0, 51, 153)
Case 2
.Color = RGB(64, 102, 178)
Case 3
.Color = RGB(128, 153, 204)
Case 4
.Color = RGB(102, 102, 255)
Case 5
.Color = RGB(140, 140, 255)
Case 6
.Color = RGB(178, 178, 255)
Case 7
end select
Next
I hope this will help you!!!
Best regards,
Shiva