|
-
May 18th, 2001, 10:05 AM
#1
Thread Starter
Junior Member
Find and grab a substring in Excel
Ok, quick question, I am attempting to find a chunk of text in a string and place that chunk into its own string.
So say I have
"This is my string"
and I want to grab "my" out of the bunch and stick it in another string.
This wouldn't be a prob... However, the string varies and sometimes "my" is not going to exist.
Any suggestions, I had thought at first just loop thru till " " was encountered then read first letter, see if its what I want, if not go to next word, etc...
Tho dunno how the heck to do this in VB(somewhat VB handicapped 
Any quickie suggestions? Seems fairly easy, but I can't really think of a non sadistic way of taking it.
Mark Wight
x86 ASM, AS11 ASM, C, C++, Java.
-
May 18th, 2001, 10:07 AM
#2
Thread Starter
Junior Member
Erh, quick addition
The string might also be "and so this my string" still want to get "my"
Mark Wight
x86 ASM, AS11 ASM, C, C++, Java.
-
May 18th, 2001, 10:10 AM
#3
Fanatic Member
Code:
MsgBox InStr("This is my string", "my")
Returns 0 if it doesn't find it, otherwise returns the position at which it was found.
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
|