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

je desespere: pb avec plages et graphiques

1 réponse
Avatar
victor
Je suis au bord du suicide.

Voici mon pb:
Avec la creation des mcros automatique j'obtiens la macro
suivante pour la creation d'un graphe:

***********************************
Sub Macro10()
Range("G1:H3").Select
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets
("REPORT").Range("G1:H3"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="REPORT"
ActiveChart.HasTitle = False
End Sub
*************************************

J'ai besoin d'ecrire "Range" sous la forme de "Cells",
j'ecris alors:

**************************************
Sub Macro10()
Range(Cells(1, 7), Cells(3, 8)).Select
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets
("REPORT").Range(Cells(1, 7), Cells(3, 8)), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="REPORT"
ActiveChart.HasTitle = False
End Sub
**************************************

Et la ca ne marche plus!!!!!!!!!!!!!!!!!!!!!!!!
Une idee serait la bienvenue
Je craque.

Victor

1 réponse

Avatar
Ellimac
Bonjour,

J'ai déjà remarqué ce problème suite à l'enregistrement
macro. Solution virer ce qui gène car pas nécessaire.

Sub Macro10()
Range(Cells(1, 7), Cells(3, 8)).Select
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.Location Where:=xlLocationAsObject,
Name:="REPORT"
ActiveChart.HasTitle = False
End Sub

Camille

-----Message d'origine-----
Je suis au bord du suicide.

Voici mon pb:
Avec la creation des mcros automatique j'obtiens la macro
suivante pour la creation d'un graphe:

***********************************
Sub Macro10()
Range("G1:H3").Select
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets
("REPORT").Range("G1:H3"), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="REPORT"
ActiveChart.HasTitle = False
End Sub
*************************************

J'ai besoin d'ecrire "Range" sous la forme de "Cells",
j'ecris alors:

**************************************
Sub Macro10()
Range(Cells(1, 7), Cells(3, 8)).Select
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets
("REPORT").Range(Cells(1, 7), Cells(3, 8)), PlotBy:= _
xlColumns
ActiveChart.Location Where:=xlLocationAsObject,
Name:="REPORT"
ActiveChart.HasTitle = False
End Sub
**************************************

Et la ca ne marche plus!!!!!!!!!!!!!!!!!!!!!!!!
Une idee serait la bienvenue
Je craque.

Victor
.