Here is a simple way to do it, using the Split() function, where "Needle" is the word/string you want to count:
Dim Haystack As String
Dim Needle As String
Dim a As Variant
a = Split(Haystack, Needle)
MsgBox UBound(a)
Here is a simple way to do it, using the Split() function, where "Needle" is the word/string you want to count:
Dim Haystack As String
Dim Needle As String
Dim a As Variant
a = Split(Haystack, Needle)
MsgBox UBound(a)