I've been trying for some time to write some code to conditionally format data points in a scatter plot.
The following is an extract which formats the data point style for a range of data series, not very tidy I know, but it works. I wanted to control the data point style and size of series 1-29, 29-58 etc. I know hard coding is never a good idea, but it was the best I could do.
Data labels are switched off because there are too many and the chart was crowded, however I do want the data labels to show if the sum of x-co-ord muliplied by y co-ord is greater than a stated figure
x vals are decimals between 1 and 5
y vals are decimals between 1 and 5
I want all data points where x times y >20 to have the data labels switched on.
Any suggestions would be great
Extract of existing code as follows, remainder just repeats for the for the next x series and applies a different data point style
Thanks
Private Sub Chart_Activate()
Application.ScreenUpdating = False
Dim Answer As String
Dim MyNote As String
'Place your text here
MyNote = "Do you want to update the chart?"
'Display MessageBox
Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "Chart Update")
If Answer = vbNo Then
'Code for No button Press
'MsgBox "You pressed NO!"
Else
'Code for Yes button Press
'Regulatory
Dim i As Integer
total = 0
For i = 1 To 29
ActiveChart.SeriesCollection(i).Select
Selection.MarkerStyle = 3
Selection.MarkerSize = 6
MarkerBackgroundColorIndex = 3
ActiveChart.SeriesCollection(i).ApplyDataLabels
ActiveChart.SeriesCollection(i).DataLabels.Select
Selection.ShowSeriesName = False
Selection.ShowValue = False
Next i
Bookmarks