如何在Excel中获取范围的大小 [英] How to get the size of a range in Excel

查看:160
本文介绍了如何在Excel中获取范围的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VBA,是否可以以像素或单位来获得给定范围的大小? (我不在乎哪个单位,因为我只使用它与其他测量与相同的单位相关)。

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).

谢谢。

推荐答案

范围的总体维度位于宽度高度属性。

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

这篇关于如何在Excel中获取范围的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆