Bonjour,
En fouillant sur le forum j'ai trouvé ce code proposé par Mercatog :
Cependant je n'arrive pas à l'adapter à mon utilisation (suppression d'un graphique s'il existe sinon le créer)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 Dim ws as worksheet nom = ComboBox1.Value for each ws in worksheets if ws.name=nom then ws.delete exit for end if next ws Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = nom
Merci pour votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 Dim G1 As Chart f as workchart Dim ws1 As Worksheet Dim PlageDonnees1 As Range Dim PlageX1 As Range Dim PlageY1 As Range Dim MaSerie1 As Series Dim Compteur1 As Long Dim Col1 As Long Dim Lig1 As Long Dim ws As Worksheet For Each ws In worksheets If ws.Name = ("Graphique") Then ws.Delete Exit For End If Next ws Set G1 = ThisWorkbook.Charts.Add 'Ajout d'une feuille MonGraphe au classeur G1.Name = "Graphique" G1.ChartArea.Clear 'Effacement des données du graphe G1.ChartType = xlXYScatter 'Définition du type de graphique (nuage de points)
Partager