0

Looking to include the below code as an instance of a loop through a Set range object including multiple cell values. This link provides a good overview of Debug.Print but the workings of .Address remain a mystery to me.

        Debug.Print .Address

http://www.cpearson.com/excel/DebuggingVBA.aspx

4

1 回答 1

2

.Address 必须与这样的单元格或范围相关:

Debug.Print Range("A1").Address

或者,如果您使用这样的 with 语句:

With Range("A1")
 Debug.Print .Address
End With

输出将打印到您的 vba 即时窗口,如下所示:

$A$1

在此处输入图像描述


您也可以将其写入其他位置,如下所示:

MsgBox (Range("A1").Address)

Range("B1").Value = Range("A1").Address
于 2013-10-15T17:43:43.727 回答