|
-
Mar 21st, 2000, 04:58 AM
#1
Thread Starter
Lively Member
I have a string - with a name and a code - how can I extract just the name Eg:
Simon : 5353DF
should give 'Simon'
Debbie : 3535GH
should give 'Debbie'
Any ideas?
Simon
-
Mar 21st, 2000, 05:06 AM
#2
If you always use a colon as seperator, you can search for the first colon. eg
sName = "Simon : 5353DF "
MsgBox Trim(Left(sName, InStr(sName, ":") - 1))
-
Mar 21st, 2000, 05:14 AM
#3
Hyperactive Member
Hi, Simon.
Try this code:
Dim str As String
Dim NewStr As String
str = "Simon : 5353DF"
NewStr = Mid(str, 1, InStr(1, str, ":") - 1)
MsgBox NewStr
Larisa
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
|