wie kann ich schauen ob das Wort "Hallo" in dem String strBegrüssung vorhanden ist?
gruß
swen
Sub Test()
Dim strBegrüssung As String
strBegrüssung = "hallo Herr Kollege,"
'Ohne Unterscheidung Groß/Kleinschreibung
If InStr(1, strBegrüssung, "Hallo", 1) > 0 Then
MsgBox "Hallo/hallo ist drin"
Else
MsgBox "Hallo/hallo ist nicht drin!"
End If
'oder
'Mit Unterscheidung Groß-/Kleinschreibung
If InStr(1, strBegrüssung, "Hallo") > 0 Then
MsgBox "Hallo ist drin"
Else
MsgBox "Hallo ist nicht drin!"
End If
End Sub