Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default 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   Report Post  
Posted to microsoft.public.excel.programming
MDW MDW is offline
external usenet poster
 
Posts: 117
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default 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   Report Post  
Posted to microsoft.public.excel.programming
MDW MDW is offline
external usenet poster
 
Posts: 117
Default 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
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
Adding data only if adjacent to cell labeled "male"/"female" lovesrubbaducky Excel Worksheet Functions 1 November 23rd 09 05:49 PM
retain custom date format "text" when pasting or reformatting data frustrated worker Excel Discussion (Misc queries) 2 October 28th 09 06:03 PM
Pasting "as displayed" formatted cell contents jimqual7 Excel Discussion (Misc queries) 6 September 19th 08 02:46 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc Bob Reynolds[_2_] Excel Programming 0 March 4th 04 08:52 PM


All times are GMT +1. The time now is 01:02 AM.

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

About Us

"It's about Microsoft Excel"