View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK[_3_] NickHK[_3_] is offline
external usenet poster
 
Posts: 415
Default Value between two spaces in a String

Kathy,
Fuction GetPart(InputStr as string, Position as long, Optional Delim as
string=" ") as string
GetPart=Split(InputStr,Delim)(position)
'Add error handling in case invalid values
End Function

So call it with :
Dim Val as variant
Val=GetPart("NESN 380.7 STR 01/28/2008",2)

NickHK


egroups.com...
Hi,

I have string like that :

NESN 380.7 STR 01/28/2008

and I want to be able to grab the value between the first two spaces;
380.7. I know how to find the first space but I don't know how to find
the second one.

Does anyone know?

Thanks,

Kathy