Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
ActiveSheet.ChartObjects(1).Activate
ActiveSheet.ChartObjects(ActiveSheet.ChartObjects.Count).Activate
Sub DotPlot()
'
' DotPlot Macro
' To make dot plots
'
Workbooks("NavStructure.xlsm").Sheets("Patient422_SaveMeal").Activate
ActiveSheet.Charts.Add
ActiveChart.SetSourceData Source:=Range("'Patient422_SaveMeal'!$C$2:$V$50")
ActiveChart.ChartType = xlXYScatter
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = "='Patient422_SaveMeal'!$C$2:$C$50"
ActiveChart.SeriesCollection(1).Values = "='Patient422_SaveMeal'!$D$2:$D$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Values = "='Patient422_SaveMeal'!$E$2:$E$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).Values = "='Patient422_SaveMeal'!$F$2:$F$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(4).Values = "='Patient422_SaveMeal'!$G$2:$G$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(5).Values = "='Patient422_SaveMeal'!$H$2:$H$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(6).Values = "='Patient422_SaveMeal'!$I$2:$I$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(7).Values = "='Patient422_SaveMeal'!$J$2:$J$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(8).Values = "='Patient422_SaveMeal'!$K$2:$K$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(9).Values = "='Patient422_SaveMeal'!$M$2:$M$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(10).Values = "='Patient422_SaveMeal'!$N$2:$N$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(11).Values = "='Patient422_SaveMeal'!$O$2:$O$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(12).Values = "='Patient422_SaveMeal'!$P$2:$P$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(13).Values = "='Patient422_SaveMeal'!$Q$2:$Q$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(14).Values = "='Patient422_SaveMeal'!$R$2:$R$50"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(15).Values = "='Patient422_SaveMeal'!$L$2:$L$50"
Dim ser As Series
For Each ser In ActiveChart.SeriesCollection
ser.MarkerStyle = 8
Next
' For i = 1 To 15
' ActiveChart.Legend.Select
' ActiveSheet.ChartObjects(1).Activate
' ActiveChart.Legend.LegendEntries(i).Select
' ActiveSheet.ChartObjects(1).Activate
' ActiveSheet.ChartObjects(1).Activate
' ActiveChart.SeriesCollection(i).Select
' Selection.MarkerStyle = 8
' Next i
' ActiveSheet.ChartObjects(1).Activate
' ActiveChart.Legend.Select
' ActiveSheet.ChartObjects(1).Activate '[b]
'WHY are you deleting the legend you just formatted???
' Selection.Delete '[/b]
End Sub
ActiveChart.SetSourceData Source:=Worksheets("Patient422_SaveMeal").Range("$C$2:$V$50")
Sub DotPlot()
'
' DotPlot Macro
' To make dot plots
'
Sheets("Patient422_SaveMeal").Activate
Charts.Add
ActiveChart.SetSourceData Source:=Range("$C$2:$D$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(1).Values = Range("$D$2:$D$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(2).Values = Range("$E$2:$E$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(3).Values = Range("$F$2:$F$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(4).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(4).Values = Range("$G$2:$G$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(5).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(5).Values = Range("$H$2:$H$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(6).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(6).Values = Range("$I$2:$I$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(7).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(7).Values = Range("$J$2:$J$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(8).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(8).Values = Range("$K$2:$K$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(9).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(9).Values = Range("$M$2:$M$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(10).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(10).Values = Range("$N$2:$N$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(11).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(11).Values = Range("$O$2:$O$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(12).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(12).Values = Range("$P$2:$P$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(13).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(13).Values = Range("$Q$2:$Q$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(14).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(14).Values = Range("$R$2:$R$50")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(15).XValues = Range("$C$2:$C$50")
ActiveChart.SeriesCollection(15).Values = Range("$L$2:$L$50")
ActiveChart.ApplyCustomType xlXYScatter
Dim ser As Series
On Error Resume Next
For Each ser In ActiveChart.SeriesCollection
ser.MarkerStyle = 8
Next
End Sub