salvamothe
New Member
- Joined
- Jun 22, 2011
- Messages
- 2
Dear all,
I have a macro that creates a chart. In the macro I have all the actions to edit the chart, insert the source, etc. The only part missing is renaming the Chart.
I want to rename the chart, because I keep on creating charts and deleting them on my routine and afterwards I would like to export the specific charts to powerpoint.
Here is the text that I'm using that lacks the RENAME part:
Sub Charts()
Sheets("Dashboard").Select
With ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=300, Top:=75, Height:=200)
.Chart.SetSourceData Source:=Sheets("DB1.2").Range("PieChart")
.Chart.ChartType = xl3DPieExploded
.Chart.ChartTitle.Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "AdiHaus"
.NameFarEast = "AdiHaus"
.Name = "AdiHaus"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 14
Selection.Left = 111.277
Selection.Top = -5
.Chart.Legend.Select
Selection.Height = 44.994
Selection.Top = 179.105
Selection.Left = -9.93
Selection.Width = 378.93
.Chart.PlotArea.Select
Selection.Left = -13
Selection.Width = 499
Selection.Height = 446.588
Selection.Top = 13
End With
End With
End Sub
I've tried the commands:
.Chart.Name = "NEW NAME"
or
ActiveChart.Parent.Name = "NEW NAME"
or
ActiveSheet.ChartObjects(1).Name = "NEW NAME"
BUT THEY DON't WORK.
Thanks a ton!!
I have a macro that creates a chart. In the macro I have all the actions to edit the chart, insert the source, etc. The only part missing is renaming the Chart.
I want to rename the chart, because I keep on creating charts and deleting them on my routine and afterwards I would like to export the specific charts to powerpoint.
Here is the text that I'm using that lacks the RENAME part:
Sub Charts()
Sheets("Dashboard").Select
With ActiveSheet.ChartObjects.Add _
(Left:=100, Width:=300, Top:=75, Height:=200)
.Chart.SetSourceData Source:=Sheets("DB1.2").Range("PieChart")
.Chart.ChartType = xl3DPieExploded
.Chart.ChartTitle.Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "AdiHaus"
.NameFarEast = "AdiHaus"
.Name = "AdiHaus"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 14
Selection.Left = 111.277
Selection.Top = -5
.Chart.Legend.Select
Selection.Height = 44.994
Selection.Top = 179.105
Selection.Left = -9.93
Selection.Width = 378.93
.Chart.PlotArea.Select
Selection.Left = -13
Selection.Width = 499
Selection.Height = 446.588
Selection.Top = 13
End With
End With
End Sub
I've tried the commands:
.Chart.Name = "NEW NAME"
or
ActiveChart.Parent.Name = "NEW NAME"
or
ActiveSheet.ChartObjects(1).Name = "NEW NAME"
BUT THEY DON't WORK.
Thanks a ton!!