Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Macro pour choisir l'échelle d'un graph

3 réponses
Avatar
Arnaud
Bonjour,

Je voudrais choisir l'=E9chelle d'un graph =E0 partir de 2=20
valeurs situ=E9 dans 2 cases d'Excel ;

J'ai fait la macro suivante :

Worksheets("synth=E8se").ChartObjects("Graphique=20
1").Chart.Axes(xlValue).MinimumScale =3D Worksheets
("synth=E8se").[f5]

Worksheets("synth=E8se").ChartObjects("Graphique=20
1").Chart.Axes(xlValue).MaximumScale =3D Worksheets
("synth=E8se").[f6]

Elle ne fonctionne pas, je ne comprends pas pourquoi.=20
Merci de votre aide...

Arnaud

3 réponses

Avatar
Misange
Bonjour,
Il y a un addin de Tushar mehta (gratuit) qui fait cela très bien
http://www.excelabo.net/xl/graph.php#minimaxi

Misange migrateuse http://www.excelabo.net
mail : http://cerbermail.com/?k5Q8Dh2mta

le 02/04/2004 15:13:
Bonjour,

Je voudrais choisir l'échelle d'un graph à partir de 2
valeurs situé dans 2 cases d'Excel ;

J'ai fait la macro suivante :

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MinimumScale = Worksheets
("synthèse").[f5]

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MaximumScale = Worksheets
("synthèse").[f6]

Elle ne fonctionne pas, je ne comprends pas pourquoi.
Merci de votre aide...

Arnaud



Avatar
Mathilde
Bonjour,
essaye ça

Sub Graph()

Dim Min, Max
Min = Sheets("synthèse").Range("F5")
Max = Sheets("synthèse").Range("F6")
With ActiveChart.Axes(xlValue)
.MinimumScale = Min
.MaximumScale = Max
End With
End Sub

-----Message d'origine-----
Bonjour,

Je voudrais choisir l'échelle d'un graph à partir de 2
valeurs situé dans 2 cases d'Excel ;

J'ai fait la macro suivante :

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MinimumScale = Worksheets
("synthèse").[f5]

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MaximumScale = Worksheets
("synthèse").[f6]

Elle ne fonctionne pas, je ne comprends pas pourquoi.
Merci de votre aide...

Arnaud

.



Avatar
mousnynao
Bonjour,

Avec ces quelques modif, chez moi ça fonctionne :)

Worksheets("synthèse").ChartObjects(1).Name = "Graphique 1"

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MinimumScale = Worksheets
("synthèse").[F5].Value

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MaximumScale = Worksheets
("synthèse").[F6].Value

ou encore

Worksheets("synthèse").ChartObjects(1).Chart.Axes
(xlValue).MinimumScale = Worksheets
("synthèse").[F5].Value

Worksheets("synthèse").ChartObjects(1).Chart.Axes
(xlValue).MaximumScale = Worksheets
("synthèse").[F6].Value

mousnynao!

-----Message d'origine-----
Bonjour,

Je voudrais choisir l'échelle d'un graph à partir de 2
valeurs situé dans 2 cases d'Excel ;

J'ai fait la macro suivante :

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MinimumScale = Worksheets
("synthèse").[f5]

Worksheets("synthèse").ChartObjects("Graphique
1").Chart.Axes(xlValue).MaximumScale = Worksheets
("synthèse").[f6]

Elle ne fonctionne pas, je ne comprends pas pourquoi.
Merci de votre aide...

Arnaud

.