主题
UsedRange (属性)
返回一个 Range 对象,该对象表示指定工作表上所使用的区域。只读。
示例
python
#本示例选定 Sheet1 中的已用区域
def test():
Application.Worksheets.Item("Sheet1").Activate()
Application.ActiveSheet.UsedRange.Select()
python
#本示例显示活动工作表总共使用多少单元格
def test():
print("A total of " + ActiveSheet.UsedRange.Count + " cells are used ")