有没有办法可以在单元格中搜索部分描述? 因为当我搜索像UTP这样的部分时,他给我一个错误
有个好主意?
这是我的代码
'search for a cbxItem_Nr or a cbx_Description
Sub Find_test_click()
Dim FindString As String
Dim Rng As Range
FindString = InputBox("Voer de product code in")
If Trim(FindString) <> "" Then
With Sheets("Magazijn").Range("A:B") 'searches all of column A and B
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True 'value found
Else
MsgBox "Opgegeven product Niet gevonden" '(MsgBox) Saying Did not find the product
End If
End With
End If
End Sub
在代码中有一些荷兰语
答案 0 :(得分:0)
不确定我是否理解了这个问题,但可能会尝试使用“xlPart”代替“xlWhole”作为lookAt参数。