ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create chart at a cell address? (https://www.excelbanter.com/excel-programming/371728-create-chart-cell-address.html)

[email protected]

Create chart at a cell address?
 
Is there a way to create a new chart at a certain cell address?

Currently I'm using:

ActiveSheet.ChartObjects.Add(450, 50, 400, 300).Select
ActiveChart.ChartType = xlXYScatterLines

To create a new chart. instead of pixel offsets, I'd like to create a
chart at Range("E5") for example.

Any ideas?

Thanks!


Peter T

Create chart at a cell address?
 
Dim cht As Chart

With ActiveSheet.Range("E5")
Set cht = ActiveSheet.ChartObjects.Add(.Left, .Top, 400, 300).Chart
End With

cht.ChartType = xlXYScatterLines
'etc

Regards,
Peter T



wrote in message
oups.com...
Is there a way to create a new chart at a certain cell address?

Currently I'm using:

ActiveSheet.ChartObjects.Add(450, 50, 400, 300).Select
ActiveChart.ChartType = xlXYScatterLines

To create a new chart. instead of pixel offsets, I'd like to create a
chart at Range("E5") for example.

Any ideas?

Thanks!




[email protected]

Create chart at a cell address?
 
The .left and .top properties of a range is handy. Thanks.


Peter T wrote:
Dim cht As Chart

With ActiveSheet.Range("E5")
Set cht = ActiveSheet.ChartObjects.Add(.Left, .Top, 400, 300).Chart
End With

cht.ChartType = xlXYScatterLines
'etc

Regards,
Peter T



wrote in message
oups.com...
Is there a way to create a new chart at a certain cell address?

Currently I'm using:

ActiveSheet.ChartObjects.Add(450, 50, 400, 300).Select
ActiveChart.ChartType = xlXYScatterLines

To create a new chart. instead of pixel offsets, I'd like to create a
chart at Range("E5") for example.

Any ideas?

Thanks!




All times are GMT +1. The time now is 02:04 PM.

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