Escanaba
asked on
Excel 2007 VB To Move & Resize Chart
Hello Experts,
What do I need to modify on the attached code that will capture moving and resizing a chart? When I look at the macro recorder it only comes up with:
ActiveSheet.ChartObjects(" Chart 6").Activate
ActiveChart.ChartArea.Sele ct
ActiveSheet.ChartObjects(" Chart 6").Activate
Which generates a 'cannot find defined name' error. I'm trying to slide the chart to the left and expand it's width.
Thanks
What do I need to modify on the attached code that will capture moving and resizing a chart? When I look at the macro recorder it only comes up with:
ActiveSheet.ChartObjects("
ActiveChart.ChartArea.Sele
ActiveSheet.ChartObjects("
Which generates a 'cannot find defined name' error. I'm trying to slide the chart to the left and expand it's width.
Thanks
Sheets("Report").Select
Range("A27").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Pivot Table Data").Range("A25:B42")
ActiveChart.Legend.Select
Selection.Delete
ActiveChart.SetElement (msoElementChartTitleAboveChart)
ActiveChart.ChartTitle.Text = "% of Time"
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "0%"
ActiveChart.SetElement (msoElementDataLabelOutSideEnd)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ActiveChart.ChartArea.Top= 150
you also have .height available
ASKER
Thank you Thomas!
You're welcome, glad to help.
Thomas
Thomas
ASKER
How do I get the chart to move down?