【发布时间】:2012-06-28 17:50:11
【问题描述】:
我有一个范围变量“rng”。 我需要将 rng 设置为: (1) 工作表上的 usedrange 不包括第一列,并且 (2) 以第6列为例
目前,我有:
Set rng = Intersect(.UsedRange, .Columns(6)).SpecialCells(xlCellTypeVisible)
' Because the range is filtered and i only need to select visible cells
但这会返回一个包含标题行的列。我只需要列中的数字。
(1) 任何快速的功能/方法/属性可以做到这一点? (2) 我如何找到这个范围的大小? rng.rows.count 总是返回 ONE,即使 rng 中有多个单元格。我应该使用 rng.count 吗?有什么区别?
非常感谢,
阿尔
【问题讨论】:
-
.usedrange.offset(0,1).resize(.usedrange.rows.count,usedrange.columns.count-1)
标签: excel vba set intersect header-row