Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pasting data following the last " " in a cell
I have a column which contains data separated by " " in two or more
locations within each cell. I need to paste the farthest right data into another cell. Example: Names Places Cities etc. I have searched the Posts her for an idea but nothing gets the desired result. I have even tried replacing " " with " " but there still are two or more of these. Any ideas would be greatly appreciated. -- Best wishes, Jim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pasting data following the last " " in a cell
Sounds like you need the InStrRev() function. It finds the LAST instance of a
search string within a source string, but the return value is relative to the regular order. strC = "Names Places Cities" intRev = InStrRev(strC,"") strLast = Trim(Mid(strC,intRev + 1)) Range("D3").Value = strLast -- Hmm...they have the Internet on COMPUTERS now! "Jim Jackson" wrote: I have a column which contains data separated by " " in two or more locations within each cell. I need to paste the farthest right data into another cell. Example: Names Places Cities etc. I have searched the Posts her for an idea but nothing gets the desired result. I have even tried replacing " " with " " but there still are two or more of these. Any ideas would be greatly appreciated. -- Best wishes, Jim |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pasting data following the last " " in a cell
It works perfectly!
Thank you. This has been about to drive me more nuts than I already am. It just goes to show, no matter how much one thinks he has learned, the surface has only begun to be scratched. -- Best wishes, Jim "MDW" wrote: Sounds like you need the InStrRev() function. It finds the LAST instance of a search string within a source string, but the return value is relative to the regular order. strC = "Names Places Cities" intRev = InStrRev(strC,"") strLast = Trim(Mid(strC,intRev + 1)) Range("D3").Value = strLast -- Hmm...they have the Internet on COMPUTERS now! "Jim Jackson" wrote: I have a column which contains data separated by " " in two or more locations within each cell. I need to paste the farthest right data into another cell. Example: Names Places Cities etc. I have searched the Posts her for an idea but nothing gets the desired result. I have even tried replacing " " with " " but there still are two or more of these. Any ideas would be greatly appreciated. -- Best wishes, Jim |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pasting data following the last " " in a cell
No problem. Glad I could help! :)
-- Hmm...they have the Internet on COMPUTERS now! "Jim Jackson" wrote: It works perfectly! Thank you. This has been about to drive me more nuts than I already am. It just goes to show, no matter how much one thinks he has learned, the surface has only begun to be scratched. -- Best wishes, Jim "MDW" wrote: Sounds like you need the InStrRev() function. It finds the LAST instance of a search string within a source string, but the return value is relative to the regular order. strC = "Names Places Cities" intRev = InStrRev(strC,"") strLast = Trim(Mid(strC,intRev + 1)) Range("D3").Value = strLast -- Hmm...they have the Internet on COMPUTERS now! "Jim Jackson" wrote: I have a column which contains data separated by " " in two or more locations within each cell. I need to paste the farthest right data into another cell. Example: Names Places Cities etc. I have searched the Posts her for an idea but nothing gets the desired result. I have even tried replacing " " with " " but there still are two or more of these. Any ideas would be greatly appreciated. -- Best wishes, Jim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding data only if adjacent to cell labeled "male"/"female" | Excel Worksheet Functions | |||
retain custom date format "text" when pasting or reformatting data | Excel Discussion (Misc queries) | |||
Pasting "as displayed" formatted cell contents | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc | Excel Programming |