am trying to use a toggle button in excel to change the color of certain points on a xy scatter plot based on the xy values from a data sereies. I wrote a macro that changes a specific point on the gragh,but i am trying to understand how to change the color based on the xy values of the data series as opposed to a point (example point 69) in the code.
Thanks for the help in advance
vb Code:
Private Sub ToggleButton10_Click()
If ToggleButton10.Value Then
Columns("CXI").Select
Selection.EntireColumn.Hidden = True
Else
Columns("CXI").Select
Selection.EntireColumn.Hidden = False
Sheets("Benzene").Select
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(69).Select
With Selection.Border
.ColorIndex = 43
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = 43
.MarkerForegroundColorIndex = 43
.MarkerStyle = xlDiamond
.MarkerSize = 5
.Shadow = False
End With
End If
End Sub
Thanks for the help in advance
vb Code:
Private Sub ToggleButton10_Click()
If ToggleButton10.Value Then
Columns("CXI").Select
Selection.EntireColumn.Hidden = True
Else
Columns("CXI").Select
Selection.EntireColumn.Hidden = False
Sheets("Benzene").Select
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Points(69).Select
With Selection.Border
.ColorIndex = 43
.Weight = xlThin
.LineStyle = xlContinuous
End With
With Selection
.MarkerBackgroundColorIndex = 43
.MarkerForegroundColorIndex = 43
.MarkerStyle = xlDiamond
.MarkerSize = 5
.Shadow = False
End With
End If
End Sub