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
| Option Explicit
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub afficherPointsGraphiqueProgressivement_V02()
Dim j As Integer, Plage As Range, ch As ChartObject
Set ch = Worksheets("Feuil1").ChartObjects.Add(250, 250, 350, 250)
With ch.Chart
.ChartType = xlXYScatter
.SeriesCollection.Add Worksheets("Feuil1").Range("C2:C2") 'ordonnées
.SeriesCollection(1).XValues = Worksheets("Feuil1").Range("B2:B25") 'abscisses
.Axes(xlCategory).MinimumScale = 0
.Axes(xlCategory).MaximumScale = Application.WorksheetFunction.Max(Worksheets("Feuil1").Range("B2:B25"))
.Axes(xlValue).MinimumScale = 0
.Axes(xlValue).MaximumScale = Application.WorksheetFunction.Max(Worksheets("Feuil1").Range("C2:C25"))
End With
For j = 2 To 25
Sleep 100 ' 0,1 secondes
ch.Chart.SeriesCollection(1).Values = Worksheets("Feuil1").Range("C2:C" & j)
ch.Visible = True
Next j
End Sub |
Partager