0

当我尝试将范围定义为相对于当前单元格的单个单元格时,我收到一个范围失败的错误:

If target.Cells.Column = 2 Then
    If target.Cells.Row > 3 Then
        If target.Cells.Count = 1 Then
        Range(ActiveCell.Offset(0, 1)).Select
        End If
    End If
End If

我知道我可以在当前单元格中创建范围,然后再进行偏移,但我只想定义范围

4

1 回答 1

0
Dim c As Range

If target.Cells.Count = 1 Then
    If target.Row > 3 and target.Column = 2 Then
        Set c = target.Offset(0, 1)
        'do something with c
    End If
End If
于 2013-09-14T22:32:23.163 回答