写成数组,写成循环。
Dim ary() As String = {"内科", "外科", "神经系统"}
Dim str As String = "内科神经系统"
Dim r As Row
Dim flag As Boolean = True
For Each s As String In ary
If str.Contains(s) Then
If r(s & "_确认检查") = False Then
msgbox(s & "没检查")
flag = False
Exit For
End If
End If
Next
if flag = true then
msgbox("全部检查了")
end if