Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
=MID(SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1,"
",""))),FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255) On Mon, 24 Jan 2005 09:49:02 -0800, "Michael" wrote: I need to find the last space from the right of text in a cell and then return the text that is to the right of that last space. Any help is greatly appreciated. Thanks |
#2
![]() |
|||
|
|||
![]()
Thanks to both of you for posting suggestions and answers. This was very
helpful. "Myrna Larson" wrote: =MID(SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))),FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255) On Mon, 24 Jan 2005 09:49:02 -0800, "Michael" wrote: I need to find the last space from the right of text in a cell and then return the text that is to the right of that last space. Any help is greatly appreciated. Thanks |
#3
![]() |
|||
|
|||
![]()
Put this function in a REGULAR module and then =fls(d10) will work.
Function FLS(X) FLS = Right(X, Len(X) - InStrRev(X, " ")) End Function A macro to do that for the active cell. Sub FLSS() MsgBox Right(ActiveCell, Len(ActiveCell) - InStrRev(ActiveCell, " ")) End Sub ===== if your version does not have instrev then use this Function InStrRev(Strng As String, Char As String) As Integer Dim Lngth As Integer, i As Integer Lngth = Len(Strng) For i = Lngth To 1 Step -1 If Mid(Strng, i, 1) = Char Then InStrRev = i Exit Function End If Next i End Function 'Howard Groves cmmroom@ ddre.detroitdiesel.com ========= -- Don Guillett SalesAid Software "Michael" wrote in message ... I need to find the last space from the right of text in a cell and then return the text that is to the right of that last space. Any help is greatly appreciated. Thanks |
#4
![]() |
|||
|
|||
![]()
On Mon, 24 Jan 2005 09:49:02 -0800, "Michael"
wrote: I need to find the last space from the right of text in a cell and then return the text that is to the right of that last space. Any help is greatly appreciated. Thanks Assuming that there are no tilde's in your original text: =MID(A1,FIND("~",SUBSTITUTE(A1," ","~", LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,1024) will do what you describe. --ron |
#5
![]() |
|||
|
|||
![]()
Ron,
Your resonse on this was perfect for what I am looking for. Is there also a way to return the data BEFORE (or the left) of the space? "Ron Rosenfeld" wrote: On Mon, 24 Jan 2005 09:49:02 -0800, "Michael" wrote: I need to find the last space from the right of text in a cell and then return the text that is to the right of that last space. Any help is greatly appreciated. Thanks Assuming that there are no tilde's in your original text: =MID(A1,FIND("~",SUBSTITUTE(A1," ","~", LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,1024) will do what you describe. --ron |
#6
![]() |
|||
|
|||
![]()
Think about it and you will be able to come up with the answer yourself.
Best to keep responses in the ORIGINAL thread for continuity. -- Don Guillett SalesAid Software "gennario" wrote in message ... Ron, Your resonse on this was perfect for what I am looking for. Is there also a way to return the data BEFORE (or the left) of the space? "Ron Rosenfeld" wrote: On Mon, 24 Jan 2005 09:49:02 -0800, "Michael" wrote: I need to find the last space from the right of text in a cell and then return the text that is to the right of that last space. Any help is greatly appreciated. Thanks Assuming that there are no tilde's in your original text: =MID(A1,FIND("~",SUBSTITUTE(A1," ","~", LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,1024) will do what you describe. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to find replace text or symbol with carriage return | New Users to Excel | |||
Excel has a "Find Next" command but no "Find Previous" command. | Excel Discussion (Misc queries) | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) | |||
how to hyperlink text to a cell | New Users to Excel | |||
Macro or Function to make text size to suite text Length? | Excel Discussion (Misc queries) |