Units Conversions

The InchesToPoints function converts a measurement given in inches to one given in points. The reason this is important is that many Excel values need to be given (or are returned) in points, but most of us prefer to think in inches (there are 72 points in one inch).

This applies especially to positioning properties, such as Top and Left. For instance, the Top property of a ChartObject specifies the location of the top of the chart object, measured in points, from Row 1 of the worksheet. Thus, to set this value to .25 inches, we would write:

ActiveChart.ChartObject.Top = InchesToPoints(.25)

There is also a PointsToInches function that is useful for displaying the return value of a function in inches when the function returns the value in points.

0 0

Post a comment