dim strSource as string
dim strResult(20) as string
dim strTmp as string
dim i as integer ,j as integer
dim A1 as string ,A2 as string ,A3 as string
strSource = 110293-18765-09876
i = 1
strResult(1) = ""
For j = 1 To len(strSource)
strTmp = Mid(strSource , j, 1)
If sTmp <> "-" Then
strResult(i) = strResult(i) & strTmp
Else
i = i + 1
strResult(i) = ""
End If
Next j
Public Function Extract(Text As String, strSeparator As String, ByVal Index As Long) As String
Dim strColl As New VBA.Collection
Dim lngStart As Long 'the first place finding begin
Dim lngLoc As Long 'the position of ","
Dim lngLocPrev As Long
Dim blnEnd As Boolean
blnEnd = False
lngStart = 1
lngLocPrev = 0
Do While Not blnEnd
lngLoc = VBA.InStr(lngStart, Text, strSeparator)
If lngLoc <> 0 Then
If (lngLoc <> lngStart) Then
strColl.Add VBA.Mid(Text, lngStart, lngLoc - lngStart)
End If
lngStart = lngLoc + VBA.Len(VBA.Trim(strSeparator))
Else
strColl.Add VBA.Mid(Text, lngStart)
blnEnd = True
End If
Loop
If (0 <= Index) And (Index < strColl.count) Then
Extract = VBA.Trim(strColl.Item(Index + 1))
Else
Extract = ""
End If
Set strColl = Nothing
End Function