Help understanding the following VBA code......

F

Frank

Can anyone help me decifer the following:

PALeft = ExecuteExcel4Macro("get.chart.item
(1,1,""Plot"")") -1

I've inherited a spreadsheet which contains a macro for
determining the slope of a line drawn on a chart. I've
spent hours going through "help" trying to understand the
code in this particular macro.

I've just included the first line.........the other lines
are similar.

Any help would be appreciated.

Thanks
 
T

Tom Ogilvy

GET.CHART.ITEM(x_y_index, point_index, item_text)


Returns the vertical or horizontal position of a point on a chart item. Use
these position numbers with FORMAT.MOVE and FORMAT.SIZE to change the
position and size of chart items. Position is measured in points; a point is
1/72nd of an inch.


x_y_index: 1 is horizontal, 2 is vertical

point_index 1 is lower or left, 2 is upper or right

Item_text is a selection code that specifies which item of a chart to
select. See the chart form of SELECT for the item_text codes to use for each
item of a chart.

So this gets the horizontal position of the bottom of the plot area I would
guess.

seems like it would be easier to use the slope and intercept functions
against the data being plotted (if that is what you are doing)

set rangeY = Range("B1:B10")
set rangeX = Range("A1:A10")
dblSlope = Application.Slope(rangeY, rangeX)
dblIntercept = Application.Intercept(rangeY,rangeX)


Regards,
Tom Ogilvy
 

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

Top