How to specify location for chart in VBA

F

Fred Smith

I'm adding a chart to an existing spreadsheet with the following:

ActiveChart.Location Where:=xlLocationAsObject, Name:="IPS"

However, it's leaving too much which space between the bottom of the
existing data, and the start of the chart.

Can I specify a specific cell location for the chart to be place? Something
like:

activechart.location where:=Range("A42"), Name:="IPS"

Thanks
Fred
 
J

Jim Cone

An embedded chart is contained within a ChartObject so...
With ActiveChart.Parent
.Top = .Parent.Range("C5").Top
.Left = .Parent.Range("C5").Left
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Fred Smith"
wrote in message
I'm adding a chart to an existing spreadsheet with the following:
ActiveChart.Location Where:=xlLocationAsObject, Name:="IPS"
However, it's leaving too much which space between the bottom of the
existing data, and the start of the chart.
Can I specify a specific cell location for the chart to be place? Something
like:
activechart.location where:=Range("A42"), Name:="IPS"
Thanks
Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top