How to get the size of a range in Excel

2019-04-03 12:35发布

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.

2条回答
Luminary・发光体
2楼-- · 2019-04-03 13:10

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
查看更多
Summer. ? 凉城
3楼-- · 2019-04-03 13:31

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

查看更多
登录 后发表回答