views:

133

answers:

2

Hello,

Using VBA, is it possible to get the size of a given range in terms of pixels or units? (I don't care which unit as I am only using it to relate to other measurements with the same unit).

Thanks.

+5  A: 

The overall dimensions of a range are in its Width and Height properties.

Dim r As Range
Set r = ActiveSheet.Range("A4:H12")

Debug.Print r.Width
Debug.Print r.Height
Tomalak
Yep, just realized myself! Blindingly obvious in retrospect :-)
Cameron
+3  A: 

The Range object has both width and height properties, which are measured in points.

Chris McCall
Thanks for the heads up on the units.
Cameron