+ Reply to Thread
Results 1 to 6 of 6

How to extract digits from a string?

  1. #1
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    How to extract digits from a string?

    Hi,
    My cells contain data in this syntax: 0002, 0040, 0402 etc. (road numbers)
    I need a macro that returns only 2, 40, 402, respectively. Basically the e digits to the right of the last zero.
    Help with the code is needed.
    Please * if you like the answer

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to extract digits from a string?

    In B2

    Paste this formula and drag it down

    =VALUE(A2)
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    12-30-2012
    Location
    Israel
    MS-Off Ver
    2007, 2016
    Posts
    642

    Re: How to extract digits from a string?

    Cheers Very practical function..

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to extract digits from a string?

    Thank you for the feedback

  5. #5
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: How to extract digits from a string?

    Quote Originally Posted by AlKey View Post
    In B2

    Paste this formula and drag it down

    =VALUE(A2)
    Nice, AlKey.

    I did the longer way of making a function saving defined as long:

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: How to extract digits from a string?

    No need of Macro/Function

    Select Col.A - [Data] - [Text to columns] - [OK]

+ 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. 5 digits number extract
    By lukasz_rz in forum Excel General
    Replies: 0
    Last Post: 10-18-2013, 04:53 AM
  2. extract digits from a cell
    By andywil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-21-2013, 09:19 AM
  3. [SOLVED] Excel 2007 : Extract last four digits from alphanumberical string
    By questionguy in forum Excel General
    Replies: 5
    Last Post: 07-16-2012, 12:51 PM
  4. Replies: 11
    Last Post: 11-16-2011, 12:56 PM
  5. Formula to extract digits from a text string?
    By Hash@example.org in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-15-2006, 12:16 AM

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