View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
PCC PCC is offline
external usenet poster
 
Posts: 6
Default VBA SPLIT FUNCTION

My first time using this passport.
It's great and so is your response
thanx a lot
-----Original Message-----
Dim str As String
str = "Duck, Donald"
MsgBox Left(str, InStr(str, ",") - 1)

"PCC" wrote in

message
...
I need to get the left portion of a variable length

string
up to the comma delimiter. I tried the Split function

but
apparently I'm not getting it right.
For Example:

Ex1:
The string: "Duck, Donald - 8765"
I want to get "Duck"

Ex2:
The String: "Mouse, Mickey - 3456"
I want to get "Mouse"



.