OVH Cloud OVH Cloud

Où est le vice ?

4 réponses
Avatar
garnote
Bonchoir le monde,

Des fois, ça marche, des fois ça marche pas !!!
Auriez-vous une idée pour expliquer cette infamie ?

Sub ChangeY()
y1 = Range("py")
y2 = Range("gy")
With ActiveSheet.ChartObjects("GraphiqueGarno"). _
Chart.Axes(xlValue)
.MinimumScale = y1 ' C'est ici que ça bloque
.MaximumScale = y2
.MajorUnitIsAuto = True
End With
End Sub

;-)

Serge

4 réponses

Avatar
Philippe.R
Bonsoir Serge,
Et avec y1 = Range("py").value ?
Par ailleurs, qu'y a t il en py ?
--
Amicales Salutations

Retirer A_S_ pour répondre.
XL97 / XL2002

"garnote" a écrit dans le message de news:c2Bob.738$
Bonchoir le monde,

Des fois, ça marche, des fois ça marche pas !!!
Auriez-vous une idée pour expliquer cette infamie ?

Sub ChangeY()
y1 = Range("py")
y2 = Range("gy")
With ActiveSheet.ChartObjects("GraphiqueGarno"). _
Chart.Axes(xlValue)
.MinimumScale = y1 ' C'est ici que ça bloque
.MaximumScale = y2
.MajorUnitIsAuto = True
End With
End Sub

;-)

Serge




Avatar
AV
......
.MinimumScale = [py]
.MaximumScale = [gy]
......

AV
Avatar
isabelle
bonjour Serge,

la référence des plages py et gy est bien mit en absolu ?

isabelle


Bonchoir le monde,

Des fois, ça marche, des fois ça marche pas !!!
Auriez-vous une idée pour expliquer cette infamie ?

Sub ChangeY()
y1 = Range("py")
y2 = Range("gy")
With ActiveSheet.ChartObjects("GraphiqueGarno"). _
Chart.Axes(xlValue)
.MinimumScale = y1 ' C'est ici que ça bloque
.MaximumScale = y2
.MajorUnitIsAuto = True
End With
End Sub

;-)

Serge


Avatar
garnote
Merci à Philippe, au capitaine Crochet et à Isabelle.

J'essayais de mettre au point un système permettant
de contrôler les bornes en X et en Y d'un graphique.
Là, ça y est et mon code semble minimal !


Dim AX As Object
Dim AY As Object

Sub Nomme()
Set AX = ActiveSheet.ChartObjects("graphe").Chart.Axes(xlValue)
Set AY = ActiveSheet.ChartObjects("graphe").Chart.Axes(xlCategory)
End Sub

Sub ÉchelleExcel()
Call Nomme
With AX
.MinimumScaleIsAuto = True
.MaximumScaleIsAuto = True
End With
With AY
.MinimumScaleIsAuto = True
.MaximumScaleIsAuto = True
End With
End Sub

Sub ÉchellePersonnalisée()
Call Nomme
Range("px") = [pxm]
Range("gx") = [gxm]
With AX
.MinimumScale = [py]
.MaximumScale = [gy]
End With
With AY
.MinimumScale = [pxm]
.MaximumScale = [gxm]
End With
End Sub

Serge


"isabelle" a écrit dans le message de news:

bonjour Serge,

la référence des plages py et gy est bien mit en absolu ?

isabelle


Bonchoir le monde,

Des fois, ça marche, des fois ça marche pas !!!
Auriez-vous une idée pour expliquer cette infamie ?

Sub ChangeY()
y1 = Range("py")
y2 = Range("gy")
With ActiveSheet.ChartObjects("GraphiqueGarno"). _
Chart.Axes(xlValue)
.MinimumScale = y1 ' C'est ici que ça bloque
.MaximumScale = y2
.MajorUnitIsAuto = True
End With
End Sub

;-)

Serge