+ Reply to Thread
Results 1 to 10 of 10

Removing unwanted characters after a number

  1. #1
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Removing unwanted characters after a number

    I have a list of data arranged in column A that looks like this:

    Blank
    Neg2
    Tom_Tom
    Bob_Bob4
    123566_A_B
    135325_S_G_F
    John
    13543556_D
    13254322
    16513545_B_D_S_R_S
    Bill_Bill
    Larry

    I have been trying to figure out a code that will remove anything after the numbers in the list, so 123566_A_B would become 123566, along with all the other rows of data that starts with numbers. The other rows that start with

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Removing unwanted characters after a number

    Are all the cells, in which you want to remove the characters, seperated by an underscore?

  3. #3
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Removing unwanted characters after a number

    Yes, always.

  4. #4
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Removing unwanted characters after a number

    it looks like I didn't finish my original post, but I meant to say that anything else in the list with an underscore does not need to be removed, only the rows that start with a number.

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Removing unwanted characters after a number

    Based upon the parameters you have supplied this should do as you have asked

    Please Login or Register  to view this content.

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Removing unwanted characters after a number

    Hi Rayden,

    Here is my code to do the task also. I have a User Defined Function that looks for a number in the first character and then trims at the underscore character.
    I think stnkynts code will work also but he uses For Each and Split that is harder than normal string functions.

    Please Login or Register  to view this content.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Removing unwanted characters after a number

    Wow that works perfectly! thank you! Now is there any way to have this to loop through all the pages in my workbook, with the exception of "Master" and "Plate"?

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Removing unwanted characters after a number

    Hey Rayden,

    Here is a Sub that will loop through all sheets an do the above.
    Please Login or Register  to view this content.
    Last edited by MarvinP; 02-20-2015 at 01:11 PM.

  9. #9
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Removing unwanted characters after a number

    My Code:
    Please Login or Register  to view this content.
    Marvin's Code:
    Please Login or Register  to view this content.
    That way you have options

  10. #10
    Forum Contributor
    Join Date
    03-26-2014
    Location
    Kentucky
    MS-Off Ver
    Excel 2013
    Posts
    128

    Re: Removing unwanted characters after a number

    Wow you guys are amazing! You have exceeded my expectations! Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Removing a set of unwanted characters from a column
    By Rob8489 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-23-2013, 08:28 PM
  2. removing unwanted characters
    By djbetterly in forum Excel General
    Replies: 4
    Last Post: 05-06-2008, 12:22 PM
  3. Removing unwanted characters
    By Richard in forum Excel General
    Replies: 2
    Last Post: 06-23-2006, 02:40 PM
  4. Removing unwanted characters
    By jermsalerms in forum Excel General
    Replies: 15
    Last Post: 01-19-2006, 05:20 PM
  5. Removing unwanted characters
    By Scorpvin in forum Excel General
    Replies: 8
    Last Post: 12-05-2005, 05:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1