1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Sub Graphmagn()
' Tracer un graphique : magnétisation en fonction de Béta
Dim Plagea As Range
Dim Plageb As Range
Dim Plage As Range
' Définir la plage de données
Set Plagea = Range(Cells(2, TR + 3), Cells(m + 1, TR + 3))
Set Plageb = Range(Cells(2, TR + 5), Cells(m + 1, TR + 5))
Set Plage = Union(Plagea, Plageb)
'Propriétés du graphique
Charts.Add
ActiveChart.ChartType = xlXYScatterLines
ActiveChart.SetSourceData SourcePlage, PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Feuil1"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = _
"Evolution de la magnétisation en fonction de la température"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Température Béta"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Magnétisation"
End With
ActiveChart.HasLegend = False
End Sub |
Partager