ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help understanding the following VBA code...... (https://www.excelbanter.com/excel-programming/271424-help-understanding-following-vba-code.html)

Frank[_13_]

Help understanding the following VBA code......
 
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

Tom Ogilvy

Help understanding the following VBA code......
 
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


"Frank" wrote in message
...
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





All times are GMT +1. The time now is 06:52 AM.

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