回复 楼主 狂笨的孔明
Option Explicit
Private Sub Command1_Click()
Dim str As String
Dim A
Dim i As Integer
Dim RenSenFlag As Boolean
Dim LiLuFlag As Boolean
str = "藜芦,人参,细辛,辛勺,"
A = Split(str, ",")
For i = 0 To UBound(A)
If A(i) = "人参" Then RenSenFlag = True: Exit For
Next
For i = 0 To UBound(A)
If A(i) = "藜芦" Then LiLuFlag = True: Exit For
Next
If RenSenFlag And LiLuFlag Then
MsgBox "str中同时含有人参和藜芦", vbCritical + vbOKOnly, "警告"
End If
End Sub