我需要在一个Excel表格中找到一个名为celda的值。我正在使用以下VBA代码来查找它:
Set cell = Cells.Find(What:=celda, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False)
If cell Is Nothing Then
'do it something
Else
'do it another thing
End If
问题在于我需要在 Excel 列中查找特定的数值。我使用以下代码进行查找:
Columns("B:B").Select
Selection.Find(What:="VA22GU1", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
但是我不知道如何将其适应于第一个VBA代码,因为我必须使用值nothing
。