Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to search a cell for last instance of repeating character anddelete to end of data

On Jan 15, 11:50*am, "Lazzzx" wrote:
=LEFT(A1,FIND("*",SUBSTITUTE(A1,"-","*",LEN(A1)-LEN(SUBSTITUTE(A1,"-","")))*)-1)

Note: The original textstring cannot include "*". If that is the case, you
will have to replace the two asterixes with som string that does not occur
in your original strings. Only works if the string to search for (here "-")
has the length of one character.

rgds,
Lazzzx

"GregInMI" skrev i ...



I just got hit with a hot request and am looking for commands/script
that will search the text in a cell, find the last occurance of a
repeating character and then delete the rest of the data in the cell
from that point to the end.


Here is a sample of the data I have to work with:


xxxx-xxx-xx-xxx-xxxxxxx


I want to scan to the last '-' in the cell and then delete the '-'
along with the 7 'x' characters.


Any help to leverage something that already exists versus writing a
script would be appreciated.


Regards,
Greg- Hide quoted text -


- Show quoted text -


AWESOME! Thanks everyone for the help. I used option #2 and it
worked great!
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
Character Search a cell JPS Excel Worksheet Functions 8 March 17th 08 08:21 AM
Find last instance of character in text KonaAl Excel Discussion (Misc queries) 21 November 28th 06 06:59 PM
How can I search for more than one text character in a cell? Dolores Excel Worksheet Functions 3 May 19th 05 09:44 PM
How do I search for more than one text character in one cell? Dolores Excel Worksheet Functions 0 May 19th 05 06:54 PM
Search for a specific character in a cell in an if statement mcl Excel Worksheet Functions 2 January 4th 05 09:14 PM


All times are GMT +1. The time now is 02:20 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"