View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default Using the Find function to get Left or Right data

This should be close to what you want...

Sub SplitString()
Dim aryStuff() As String
Dim strThis As String
Dim strThat As String

aryStuff = Split("9I1234-01-234-5678 / 8H1234-02-345-6789", "/")
strThis = Trim(aryStuff(0))
strThat = Trim(aryStuff(1))

MsgBox strThis
MsgBox strThat
End Sub
--
HTH...

Jim Thomlinson


"Glen" wrote:

Thanks Jim and I saw the Split Function but I was not sure how I would
get the values split into dwgNSN and dwgMFR. I have data that looks
like 9I1234-01-234-5678 / 8H1234-02-345-6789. I need to get the data
on either side of the slash because sometimes my data looks like :
9I1234- / 8H1234-02-345-6789 or even - / -. I need to evaluate these
strings later for validity. Thanks.