+ Reply to Thread
Results 1 to 11 of 11

Vba to extract number from string

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,164

    Vba to extract number from string

    Hi All
    What code can i use to extract the number from the following string i.e.
    Number 1....Result must be 1
    Number 10..result must be 10
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Vba to extract number from string

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

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

    Re: Vba to extract number from string

    See

    https://www.mrexcel.com/forum/excel-...ml#post1711974

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,164

    Re: Vba to extract number from string

    Hi mike7952

    Thanks for your reply....So how do I implement your code...in this Code
    Please Login or Register  to view this content.

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Vba to extract number from string

    Like this, change NoFound to NoFound as string

    Please Login or Register  to view this content.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,164

    Re: Vba to extract number from string

    And please excuse my ignorance but where do i put your code?

    EDIT: Not to worry Got it figured out....Thanks mike7952
    Will make use of in future.
    Last edited by sintek; 04-28-2017 at 11:58 AM.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,164

    Re: Vba to extract number from string

    @ jindon
    thanks for the link....Very helpful

    EDIT:

    What am i missing here....Feel a bit silly
    Attached is sample file...Am trying to extract Number 2 from active cell
    Attached Files Attached Files
    Last edited by sintek; 04-28-2017 at 12:07 PM.

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,164

    Re: Vba to extract number from string

    Hi mike7952

    please have a look at Post7 when you get a gap.

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Vba to extract number from string

    Where and what do you want to do with the result?

  10. #10
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Vba to extract number from string

    Please Login or Register  to view this content.

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,164

    Re: Vba to extract number from string

    That's it mike7952
    I wanted to set NoFound to the value......thanks again.

+ 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. Extract number from string
    By tieyanna in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-21-2016, 09:50 AM
  2. Mid and Mod to extract a number from string
    By jonboy6257 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-22-2013, 02:12 PM
  3. [SOLVED] How to Extract A Number from String if Text within the String Equals XYZ
    By tyrsfury in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-15-2012, 03:30 PM
  4. [SOLVED] Extract a mainly numeric string (ISSN number) from an arbitrary string
    By Buzzed Aldrin in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-04-2012, 01:49 PM
  5. Extract number out of a string
    By mkvassh in forum Excel General
    Replies: 4
    Last Post: 04-07-2010, 05:25 PM
  6. Extract Only Number From A String
    By lehainam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-26-2006, 06:45 AM
  7. How to extract the Number from a String
    By johnbest in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-19-2005, 02:30 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