【发布时间】:2016-02-22 12:13:26
【问题描述】:
我无法解决这个问题。我之前遇到过类似的问题,原来我使用的是单个单元格的 Range,这是多余的。但在这种情况下,我需要 End(xlDown) 而我无法让它工作。我尝试了一些组合,但我无法找出正确的语法。帮忙?
Public Exceptions As Range
Public Xcept As Range
Sub Example()
Static ExcSh As Worksheet
Set ExcSh = Worksheets("ComboExceptions")
Set Exceptions = ExcSh.Range("A2")
Set Xcept = ExcSh.Range(Exceptions.Offset(1).Cells, Exceptions.Offset(1).Cells.End(xlDown))
'This is where the error happens ^
End Sub
【问题讨论】:
-
删除
.Cells的两个实例 -
你没有从A3开始而不是A2然后
.Offset(1)有什么原因吗? -
有一个很好的理由是的。不管怎样,我解决了。将立即发布答案。