Comment faire pour donner au graphique obtenu
par cette macro les dimensions et les positions voulues ?
Sub Nuage()
Application.ScreenUpdating = False
Set ici = Selection
haut = ici.Top
gauche = ici.Left + ici.Width
nom = ActiveSheet.Name
Charts.Add
n = ActiveChart.Name ' ***
With ActiveChart
.ApplyCustomType ChartType:=xlXYScatterSmoothNoMarkers
.SetSourceData Source:=ici
.Location Where:=xlLocationAsObject, Name:=nom
End With
'C'est ici que ça cloche. Je voudrais utiliser n ***
'With ActiveSheet.ChartObjects(1)
' .Top = haut
' .Left = gauche
' .Height = 204
' .Width = 300
'End With
ici(1, 1).Select
End Sub
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
garnote
En passant par n = ActiveSheet.ChartObjects.Count je crois que ça y est. Avec le nom du graphique, ???
Sub Nuage() Application.ScreenUpdating = False Set ici = Selection haut = ici.Top gauche = ici.Left + ici.Width nom = ActiveSheet.Name Charts.Add With ActiveChart .ApplyCustomType ChartType:=xlXYScatterSmoothNoMarkers .SetSourceData Source:=ici .Location Where:=xlLocationAsObject, Name:=nom End With n = ActiveSheet.ChartObjects.Count With ActiveSheet.ChartObjects(n) .Top = haut .Left = gauche .Height = 204 .Width = 300 End With ici(1, 1).Select End Sub
Serge
Bonsoir, Bonsoir,
Comment faire pour donner au graphique obtenu par cette macro les dimensions et les positions voulues ?
Sub Nuage() Application.ScreenUpdating = False Set ici = Selection haut = ici.Top gauche = ici.Left + ici.Width nom = ActiveSheet.Name Charts.Add n = ActiveChart.Name ' *** With ActiveChart .ApplyCustomType ChartType:=xlXYScatterSmoothNoMarkers .SetSourceData Source:=ici .Location Where:=xlLocationAsObject, Name:=nom End With 'C'est ici que ça cloche. Je voudrais utiliser n *** 'With ActiveSheet.ChartObjects(1) ' .Top = haut ' .Left = gauche ' .Height = 204 ' .Width = 300 'End With ici(1, 1).Select End Sub
Serge
En passant par n = ActiveSheet.ChartObjects.Count
je crois que ça y est. Avec le nom du graphique, ???
Sub Nuage()
Application.ScreenUpdating = False
Set ici = Selection
haut = ici.Top
gauche = ici.Left + ici.Width
nom = ActiveSheet.Name
Charts.Add
With ActiveChart
.ApplyCustomType ChartType:=xlXYScatterSmoothNoMarkers
.SetSourceData Source:=ici
.Location Where:=xlLocationAsObject, Name:=nom
End With
n = ActiveSheet.ChartObjects.Count
With ActiveSheet.ChartObjects(n)
.Top = haut
.Left = gauche
.Height = 204
.Width = 300
End With
ici(1, 1).Select
End Sub
Serge
Bonsoir, Bonsoir,
Comment faire pour donner au graphique obtenu
par cette macro les dimensions et les positions voulues ?
Sub Nuage()
Application.ScreenUpdating = False
Set ici = Selection
haut = ici.Top
gauche = ici.Left + ici.Width
nom = ActiveSheet.Name
Charts.Add
n = ActiveChart.Name ' ***
With ActiveChart
.ApplyCustomType ChartType:=xlXYScatterSmoothNoMarkers
.SetSourceData Source:=ici
.Location Where:=xlLocationAsObject, Name:=nom
End With
'C'est ici que ça cloche. Je voudrais utiliser n ***
'With ActiveSheet.ChartObjects(1)
' .Top = haut
' .Left = gauche
' .Height = 204
' .Width = 300
'End With
ici(1, 1).Select
End Sub
En passant par n = ActiveSheet.ChartObjects.Count je crois que ça y est. Avec le nom du graphique, ???
Sub Nuage() Application.ScreenUpdating = False Set ici = Selection haut = ici.Top gauche = ici.Left + ici.Width nom = ActiveSheet.Name Charts.Add With ActiveChart .ApplyCustomType ChartType:=xlXYScatterSmoothNoMarkers .SetSourceData Source:=ici .Location Where:=xlLocationAsObject, Name:=nom End With n = ActiveSheet.ChartObjects.Count With ActiveSheet.ChartObjects(n) .Top = haut .Left = gauche .Height = 204 .Width = 300 End With ici(1, 1).Select End Sub
Serge
Bonsoir, Bonsoir,
Comment faire pour donner au graphique obtenu par cette macro les dimensions et les positions voulues ?
Sub Nuage() Application.ScreenUpdating = False Set ici = Selection haut = ici.Top gauche = ici.Left + ici.Width nom = ActiveSheet.Name Charts.Add n = ActiveChart.Name ' *** With ActiveChart .ApplyCustomType ChartType:=xlXYScatterSmoothNoMarkers .SetSourceData Source:=ici .Location Where:=xlLocationAsObject, Name:=nom End With 'C'est ici que ça cloche. Je voudrais utiliser n *** 'With ActiveSheet.ChartObjects(1) ' .Top = haut ' .Left = gauche ' .Height = 204 ' .Width = 300 'End With ici(1, 1).Select End Sub