ListObject UsedRange [英] ListObject UsedRange

查看:98
本文介绍了ListObject UsedRange的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取Excel List对象的使用范围。我的要求是获取Excel ListObject中使用范围的起始单元名称和最后一个单元名称。

解决方案

< blockquote>您好Tukuna,

我不确定您是否希望获得该列表对象的入口范围或仅仅是第一个和最后一个单元格地址。我提供了一种最简单的方法来获取两者。


'Listobject UsedRange 
Activesheet.Listobjects(1).range.address

'Listobject DataRange
Activesheet.Listobjects(1).DataBodyRange.Address

'第一个单元格地址
Activesheet.listobjects(1).Range.Cells(1 )。地址

'最后一个单元格地址
Dim n为整数$​​ b $ bn = Activesheet.Listobjects(1).cells.count
Activesheet.listobjects(1).Range .Cells(n).Address



希望这有帮助。


How to get the used range of Excel List object.My requirement is to get the start cell name and last cell name of the used range inside Excel ListObject.

解决方案

Hi Tukuna,

I am not sure if you would like to get the entrie range for that listobject or just the first and last cell address. I am providing a simplest way of getting both.

'Listobject UsedRange
Activesheet.Listobjects(1).range.address

'Listobject DataRange
Activesheet.Listobjects(1).DataBodyRange.Address

'First Cell address
Activesheet.listobjects(1).Range.Cells(1).Address

'Last Cell Address
Dim n as integer
n = Activesheet.Listobjects(1).cells.count
Activesheet.listobjects(1).Range.Cells(n).Address


Hope this helps.


这篇关于ListObject UsedRange的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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