OVH Cloud OVH Cloud

Select case & charttype

1 réponse
Avatar
René Delcourt
Bonjour à tous,

Pourquoi ce code me laisse toujours la même valeur à TypeGraph?
for x = 0 to 5
Select Case X
Case X = 0, 1, 2, 3
TypeGraph = xlBarStacked
Case X = 4
TypeGraph = xl3DPie
Case X = 5
TypeGraph = xlColumnStacked
End Select
Charts.Add
ActiveChart.SetSourceData Source:=Sheets(NomTCD).Range("A4")
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.PlotArea.Select
ActiveChart.ChartType = TypeGraph
next

Merci de vos réponses.
--
René Delcourt

1 réponse

Avatar
Daniel
Bonjour.
Utilise cette syntaxe :

Select Case X
Case 0, 1, 2, 3
TypeGraph = xlBarStacked
Case 4
TypeGraph = xl3DPie
Case 5
TypeGraph = xlColumnStacked
End Select

Cordialement.
Daniel
"René Delcourt" a écrit dans le message de news:

Bonjour à tous,

Pourquoi ce code me laisse toujours la même valeur à TypeGraph?
for x = 0 to 5
Select Case X
Case X = 0, 1, 2, 3
TypeGraph = xlBarStacked
Case X = 4
TypeGraph = xl3DPie
Case X = 5
TypeGraph = xlColumnStacked
End Select
Charts.Add
ActiveChart.SetSourceData Source:=Sheets(NomTCD).Range("A4")
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.PlotArea.Select
ActiveChart.ChartType = TypeGraph
next

Merci de vos réponses.
--
René Delcourt