hallo ,
j`ai crée un macro pour la création d`un graphique Via VBA, ca fonctionne très b1 mais la probleme et mon intervale source et variable (D670) ,il peut ce changer pour etre par exemple (D655)
ya t`il une solution pour déclarée la source varaible
mon Code est la suivant:
Sub cree_graphxxxx()
Dim NbGraph As Byte
Dim wks As Worksheet
Dim Drang As String
For Each wks In ThisWorkbook.Worksheets
If wks.Name Like "Line ##" Then
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=wks.Range("D670"), _
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:=wks.Name
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Temps de Cycle"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = ""
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Takt"
End With
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = False
.HasAxis(xlValue, xlPrimary) = True
End With
NbGraph = ActiveSheet.ChartObjects.Count 'compte le nombre de graphiques dans la feuille
'le nouveau graphique correspond à l'index le plus élevé
ActiveSheet.ChartObjects(NbGraph).Activate
ActiveChart.ChartTitle.Select
ActiveSheet.ChartObjects(NbGraph).Name = "Takt"
With ActiveSheet.Shapes("Takt")
.Left = Range("e15").Left
.Top = Range("e15").Top
End With
wks.Range("A1").Select
End If
Next wks
End Sub
j`ai crée un macro pour la création d`un graphique Via VBA, ca fonctionne très b1 mais la probleme et mon intervale source et variable (D670) ,il peut ce changer pour etre par exemple (D655)
ya t`il une solution pour déclarée la source varaible
mon Code est la suivant:
Sub cree_graphxxxx()
Dim NbGraph As Byte
Dim wks As Worksheet
Dim Drang As String
For Each wks In ThisWorkbook.Worksheets
If wks.Name Like "Line ##" Then
Charts.Add
ActiveChart.ChartType = xlLine
ActiveChart.SetSourceData Source:=wks.Range("D670"), _
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:=wks.Name
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Temps de Cycle"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = ""
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Takt"
End With
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = False
.HasAxis(xlValue, xlPrimary) = True
End With
NbGraph = ActiveSheet.ChartObjects.Count 'compte le nombre de graphiques dans la feuille
'le nouveau graphique correspond à l'index le plus élevé
ActiveSheet.ChartObjects(NbGraph).Activate
ActiveChart.ChartTitle.Select
ActiveSheet.ChartObjects(NbGraph).Name = "Takt"
With ActiveSheet.Shapes("Takt")
.Left = Range("e15").Left
.Top = Range("e15").Top
End With
wks.Range("A1").Select
End If
Next wks
End Sub