Thread: Text to Columns
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Wouter HM Wouter HM is offline
external usenet poster
 
Posts: 99
Default Text to Columns

Hi LeisaA

In Excel 2007 I used the nested cell fuction below to get everything
rigt of the first dash.

=MID(A1,SEARCH("-",A1,1)+2,LEN(A1))

You can olso use the function below:


Function RightOfFirst(strOriginal As String, strDelimiter) As String
Dim intPos As Integer

intPos = InStr(1, strOriginal, strDelimiter, vbTextCompare) + 2
If intPos 0 Then
RightOfFirst = Mid(strOriginal, intPos)
Else
RightOfFirst = strOriginal
End If

End Function


Function LeftOfFirst(strOriginal As String, strDelimiter) As String
Dim intPos As Integer

intPos = InStr(1, strOriginal, strDelimiter, vbTextCompare) + 2
If intPos 0 Then
LeftOfFirst = Left(strOriginal, InpOs)
Else
LeftOfFirst = strOriginal
End If

End Function



HTH,

Wouter.