Count the number of occurences of a character in a text box control.
Count the number of occurences of a character in a text box control.
Rate Count the number of occurences of a character in a text box control.
(2(2 Vote))
'put a text box and a command button on your form.
'count the number of v's in textbox
Dim i As Integer
Dim x As Integer
Dim count As Integer
Dim char_length As Integer
Dim char As String
x = Len(Text1)
For i = 1 To Len(Text1)
char = Mid(Text1, x, 1)
If char = "v" Then
count = count + 1
End If
x = x - 1
Next
MsgBox "There are a total of " & count & " v's", vbInformation
End Sub
Count the number of occurences of a character in a text box control. Comments
No comments yet — be the first to post one!
Post a Comment