bonjour, j'ai un étudiant qui souhaite réaliser un graphique en nuage de points avec plus de 180 données (x: le pib; y: le montant du commerce extèrieur) mais Excel ne digère pas ce grand nombre de données ! et il affecte à tous les points les mêmes abcisses et les mêmes ordonnées (sauf pour 8 valeurs !😕 )
j'ai tenté une macro vba en itération pour reprendre les valeurs de chaque point mais je bloque dessus !!
SOS
voici une copie de ma vba
Sub testyoyo()
Dim feuille As String
Dim n As Integer
Dim m As Integer
Dim a As Integer
Dim i As Integer
Dim j As Integer
feuille = InputBox("enter the sheet name", ["sheet name"])
n = InputBox("enter the firstline value ", ["first line value position"])
m = InputBox("enter the firstcolumnvalue ", ["first column value position"])
Sheets(feuille).Select
a = m
While Cells(n, m) <> ""
m = m + 1
Wend
Charts.Add
ActiveChart.ChartType = xlXYScatter
'allors là j'ai un problème pour sélectionner le tableau !!!!!!
ActiveChart.SetSourceData Source:=Sheets(feuille).Range(n&a:n+1 & m), PlotBy:=xlRows
j = 1
For i = a To m
'ici j'ai penser changer la valeur de la série avec mon itération mais il veut pas !!!!
ActiveChart.SeriesCollection(j).XValues = "=Sheet3!" & Cells(n, i)
ActiveChart.SeriesCollection(j).Values = "=Sheet3!&cells(n+1,i)"
ActiveChart.SeriesCollection(j).DataLabels.Select
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 5.5
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
j = j + 1
Next i
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
End Sub
j'ai tenté une macro vba en itération pour reprendre les valeurs de chaque point mais je bloque dessus !!
SOS
voici une copie de ma vba
Sub testyoyo()
Dim feuille As String
Dim n As Integer
Dim m As Integer
Dim a As Integer
Dim i As Integer
Dim j As Integer
feuille = InputBox("enter the sheet name", ["sheet name"])
n = InputBox("enter the firstline value ", ["first line value position"])
m = InputBox("enter the firstcolumnvalue ", ["first column value position"])
Sheets(feuille).Select
a = m
While Cells(n, m) <> ""
m = m + 1
Wend
Charts.Add
ActiveChart.ChartType = xlXYScatter
'allors là j'ai un problème pour sélectionner le tableau !!!!!!
ActiveChart.SetSourceData Source:=Sheets(feuille).Range(n&a:n+1 & m), PlotBy:=xlRows
j = 1
For i = a To m
'ici j'ai penser changer la valeur de la série avec mon itération mais il veut pas !!!!
ActiveChart.SeriesCollection(j).XValues = "=Sheet3!" & Cells(n, i)
ActiveChart.SeriesCollection(j).Values = "=Sheet3!&cells(n+1,i)"
ActiveChart.SeriesCollection(j).DataLabels.Select
Selection.AutoScaleFont = False
With Selection.Font
.Name = "Arial"
.FontStyle = "Normal"
.Size = 5.5
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With
j = j + 1
Next i
ActiveChart.Location Where:=xlLocationAsNewSheet
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
End Sub