Sub Graphique()
Dim Graph As ChartObject
Set CHOIX = Application.InputBox(prompt:="Sélectionnez la plage de cellules pour l'axe.", _
Title:="Plage de cellules", Left:=500, Top:=300, Type:=8)
With ActiveWorkbook.Worksheets(1)
Set Graph = .ChartObjects.Add(200, 100, 500, 300)
End With
With Graph.Chart
.SetSourceData Worksheets(1).Range("b1:C10")
' .ChartType = xlLine
.ApplyCustomType ChartType:=xlBuiltIn, TypeName:="Courbe - Histo. 2 axes"
.HasTitle = True
.ChartTitle.Text = "essai"
.SeriesCollection(1).XValues = CHOIX 'Range("A2:A10")
End With
ActiveSheet.ChartObjects(1).Activate
essai = MsgBox("Voulez vous la série 1 en Graph ligne !", vbYesNo + vbExclamation, "Avertissement")
If essai = vbNo Then
Exit Sub
Else
ActiveChart.SeriesCollection(1).ChartType = xlLineMarkers
ActiveChart.SeriesCollection(2).ChartType = xlColumnClustered
End If
End Sub