LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
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.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Text from 2 Columns into 1 then Deleting the 2 Columns sleepindogg Excel Worksheet Functions 5 September 19th 08 12:36 AM
help with sorting text in columns to match other columns rkat Excel Discussion (Misc queries) 1 August 11th 06 03:42 AM
merge text from 2 columns into 1 then delete the old 2 columns sleepindogg Excel Worksheet Functions 4 March 30th 06 07:25 PM
Linking text columns with text and data columns Edd Excel Worksheet Functions 0 March 17th 05 04:23 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 10:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"