Discussion Locked

Excel Chart and VBA

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am creating an application that has data output to a graph. The user has to click a button to run the macro to create the chart....which is placed as an object on the worksheet

my question is 1: how do i insert the chart at a specific location on my worksheet?..

2: if my data range is dynamic...any suggestions on how to deal with that...

1 reply

by dklippert

This from an article in the July 2002 issue of Microsoft Office Solutions.
A very good magazine to subscribe to. You can get a free try at

www.msoffice.net

The article is called Charting a New Course.

******************************

DimNewChartObject As Excel.Chart
NewChartObject=ws.ChartObjects.Add(x, y, w, h)

x, y, w, h are measured in points. You can use the following code as well:

With Application
NewChartObject=ws.ChartObjects.Add _
(.InchesToPoints(x), _
.InchesToPoints(y), _
.InchesToPoints(w), _
.InchesToPoints(h))
End With
********************************
To find out how to set up a dynamic range for a chart, go to:

http://j-walk.com/ss/excel/usertips/tip053.htm

This discussion is closed to new replies.