我正在处理VBA表单,用户需要在其中传递如下所示的ComboBox条件-
Private Sub ComboBox4_AfterUpdate()
Dim ws As Worksheet
Set ws = Worksheets("PRODUCT")
Fnsearch = ComboBox4.Value
Set searchRange = ws.Range("B:B")
Set foundCell = searchRange.Find(What:=Fnsearch, After:=searchRange.Cells(searchRange.Cells.Count))
If Not foundCell Is Nothing Then
' Doing some form work
' And want play notification sound here for user
Else
' Want play notification sound here for user
rslt = MsgBox("Kindly check product name which you typed." & vbCr & _
"Because this Item is not available in PRODUCT page." & vbCr & vbCr & _
"Kindly click Yes to Add Product or No to Discard.", vbYesNo, "Product not exists")
If rslt = vbYes Then
AddPartyA.Show
End If
End If
End Sub