ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to specify location for chart in VBA (https://www.excelbanter.com/excel-discussion-misc-queries/178015-how-specify-location-chart-vba.html)

Fred Smith[_4_]

How to specify location for chart in VBA
 
I'm adding a chart to an existing spreadsheet with the following:

ActiveChart.Location Whe=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 whe=Range("A42"), Name:="IPS"

Thanks
Fred


Jim Cone

How to specify location for chart in VBA
 
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 Whe=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 whe=Range("A42"), Name:="IPS"
Thanks
Fred



All times are GMT +1. The time now is 03:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com