我通过编写
开始了一个简单的演示Dim arrayShipmentID As Variant
我希望excel会自动选择包含值“abc”的单元格,但是,我收到一条错误消息“对象变量或未设置块变量”。我有什么不想错的吗
欣赏它。
答案 0 :(得分:2)
"https://msdn.microsoft.com/en-us/library/office/ff839746.aspx"
Sub tester()
With Worksheets(6).Range("B1:B500")
Set c = .Find("Smith Jon Junior", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address ' not required
c.Activate
else
msgbox ("Not Found")
End If
End With
End Sub