In this simple sentence which is in a userform textbox:
The sentence above has five occurrences containing 'east'. Two, eastward and beasts have 'east' contained within the word.
I just want to find all occurenes of the single, standalone word 'east', not contained within any other words.
This code finds every single occurrence:
eastward
east
beasts
east
least
The correct wildcard pattern would give only two occurrences of 'east':
east
east
Worked on this using many combinations of quotes, asterikes, etc., still not getting the correct wildcard pattern.
The variable s is the value taken from a userform textbox in the image below
Dim s As String
s = Me.TextBox1.Value
cnt = Application.CountIf(Range("E1", Range("E" & Rows.count).End(xlUp)), "*" & s & "*")
Thanks for anyone's help.
cr
Code:
He he left his home and traveled eastward toward the land of the east to settle there. Although there were many beasts in that
area he still wanted to live east of where he came from, becoming the least favorite of all his brothers.
I just want to find all occurenes of the single, standalone word 'east', not contained within any other words.
This code finds every single occurrence:
Code:
"*" & s & "*"
east
beasts
east
least
The correct wildcard pattern would give only two occurrences of 'east':
east
east
Worked on this using many combinations of quotes, asterikes, etc., still not getting the correct wildcard pattern.
The variable s is the value taken from a userform textbox in the image below
Dim s As String
s = Me.TextBox1.Value
cnt = Application.CountIf(Range("E1", Range("E" & Rows.count).End(xlUp)), "*" & s & "*")
Thanks for anyone's help.
cr