+ Reply to Thread
Results 1 to 6 of 6

removing characters from a cell

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Cadillac, MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    removing characters from a cell

    does anyone have a suggestion on how I can remove characters from a cell that contains both characters and numbers. For example, I have a cell that currently contains CK: 8042. I want a macro (or formula) that will edit the cell, and remove all the characters & spaces, and leaves me only with 8042. and then I want it to repeat the process on the next cell below it, and so on until there are no more entries to edit. Thanks

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: removing characters from a cell

    The most "natural" way would be by using regular expressions - see for instance: http://stackoverflow.com/questions/9...icrosoft-excel
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,626

    Re: removing characters from a cell

    PS. see also for instance http://www.excelforum.com/excel-gene...-digits-2.html on this forum - there is a link to simple add-in library whicj includes also regular expressions: http://download.cnet.com/Morefunc/30...-10423160.html

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: removing characters from a cell

    • Select your workbook
    • ALT+F11...to open the VBA editor
    • Insert.Module...to create a general module to hold the code
    • Copy the below VBA code and paste it into that module
    Please Login or Register  to view this content.
    • Select the range to be converted
    • ALT+F8...to open the macro window
    • Select RemoveNonNums....Click: Run

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Registered User
    Join Date
    01-13-2010
    Location
    Cadillac, MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    Re: removing characters from a cell

    Ron, that macro worked. thanks a lot

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: removing characters from a cell

    Glad you got something you can use!

    Please be sure to mark this thread as SOLVED (from the Thread Tools menu)

+ 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 4 characters from a cell
    By boomshank in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2010, 11:24 AM
  2. Removing characters from the end of a cell
    By KJW in forum Excel General
    Replies: 1
    Last Post: 05-20-2010, 08:39 AM
  3. Removing the / between characters in a cell
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2009, 08:14 AM
  4. Removing characters from a cell
    By xtrout in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-12-2007, 07:19 PM
  5. [SOLVED] removing some of the characters from a cell
    By Patience in forum Excel General
    Replies: 2
    Last Post: 05-03-2005, 04:06 PM

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