|
-
Jul 21st, 2004, 03:59 AM
#1
Thread Starter
Lively Member
Removing words from a textbox
i'm stuck 
i can't seem to make a code to remove a word, and everything after it. the word will always be "status"
how can i remove that and everything after it, but keep everything before it?
thank you
-
Jul 21st, 2004, 04:04 AM
#2
VB Code:
Dim strWord As String
Dim pos As Long
strWord = "this is a status check"
pos = InStr(1, strWord, "status", vbTextCompare)
If pos > 0 Then
strWord = Left$(strWord, pos - 1)
End If
Debug.Print strWord
-
Jul 21st, 2004, 04:07 AM
#3
Thread Starter
Lively Member
thanks!
i'm not good with this kind of stuff yet
-
Jul 21st, 2004, 04:56 AM
#4
What about
VB Code:
TextBox1.Text = Replace(TextBox1.Text, "status", "")
(Assuming same case)
-
Jul 21st, 2004, 04:57 AM
#5
Aah never mind, I didn't read the post correctly.
Leave me alone.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|