Hello,
I would appreciate any help you can give.
I have a scatter chart, excel 2013, where I have assigned code to give the
points labels. I have 9 series. I would like to assign a specific marker style for
each series (each point in series 1 is a blue circle, each point in series 2 is
a blue triangle)...
On Microsoft's website I found code such as:
Charts("Chart1").SeriesCollection(1) _
.MarkerStyle = xlMarkerStyleCircle
but I do not know where to put it inside the code I am already using (I do not really know
VBA and just copied/pasted this code.
Could you tell me where to insert this code?
*Also, if you could help me make the labels be in the center of the marker, that would be
awesome.
Thank you
Sub CreateDataLabels()
'variables for looping over chart objects
Dim FilmChart As Chart
Dim FilmDataSeries As Series
'variables for looping over cells
Dim SingleCell As Range
Dim FilmList As Range
'variable to keep track of number of films
Dim FilmCounter As Integer
FilmCounter = 1
Set FilmList = Range("A10", "A210")
Set FilmChart = ActiveSheet.ChartObjects(1).Chart
'loop over each data series and enable data labels
For Each FilmDataSeries In FilmChart.SeriesCollection
FilmDataSeries.HasDataLabels = True
Next FilmDataSeries
'loop over each cell in the list of source data
For Each SingleCell In FilmList
'loop over each series in the chart
For Each FilmDataSeries In FilmChart.SeriesCollection
'change the label text to be the film's name
FilmDataSeries.Points(FilmCounter).DataLabel.Text = SingleCell.Value
Next FilmDataSeries
FilmCounter = FilmCounter + 1
Next SingleCell
End Sub
http://www.filedropper.com/exampleversionriskmapping example file without code
Bookmarks