【发布时间】:2011-06-30 16:34:54
【问题描述】:
我正在使用 VBA Excel 中的查找函数,所以当我遇到问题时,我从 Excel 中提供的帮助中提取了一些示例代码。我拿了他们的代码来说明一个基本的 查找函数并将其粘贴到宏中。在运行宏时,我得到一个“运行时错误'91'”并且调试器突出显示包含尖括号的代码行。这些是我无法理解的代码部分。
谁能告诉我这些括号代表什么?
Sub exampleFindReplace()
With Worksheets(1).Range("a1:a500")
Set c = .Find(2, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
【问题讨论】: