View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Separating parts of a string in VBA

IF the DATE and THRU parts of your example text (along with their adjacent
blank spaces) appear in all the text strings that you want to separate, then
I would probably do it this way...

YourText = "DATE 1/1/10 THRU 3/1/10"
Begin = Split(YourText)(1)
Done = split(YourText)(3)

--
Rick (MVP - Excel)



"Andrew" wrote in message
...
Hello,
I have a string in cells(1,1). The value of the cell is "DATE" 1/1/10
THRU 3/1/10" I want to separate this string into the two new strings
such that one string would read "1/10/10" and the other would read
"3/1/10". In C programming, this would be fairly easy. But in VBA I
don't know any string functions which can read and compare individual
characters. Does anyone know how to accomplish what I am trying to
do?

thanks