Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to align an embedded chart in a worksheet?

Status
Not open for further replies.

sjh

Programmer
Oct 29, 2001
263
US
Hi, I am trying to align the charts (pie chart and bar chart) on a worksheet. I tried the following code, but I get an error with the .LEFT line.

With Worksheets("Budget Report")
'.ChartObjects("BarChart").Left = .Columns("B").Left
.ChartObjects("BarChart").Top = 200
End With

The .TOP property correctly puts the bar chart at 200, but after I add a Pie chart, the bar chart gets pushed to the bottom. Any idea why?

With Worksheets("Budget Report")
'.ChartObjects("PieChart").Left = .Columns("B").Left
.ChartObjects("PieChart").Top = 600
End With

Thank you for your help,
 
have a look at the "TopLeftCell" property of the chartobject. This will anchor the chartobject to a cell

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top