+ Reply to Thread
Results 1 to 7 of 7

Extract values from string

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Extract values from string

    Hello,

    Plese take a look at the attached screen shot.

    I need to extract the two numerical values from the cell value and place them in the next two cell as shown.
    I know how to do this with a formula, but I need it through a VBA script.

    Could you please advise?
    Thanks
    Attached Images Attached Images

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Extract values from string

    Post a sample workbook together with the formulae you are currently using.

    From there, coding VBA is simple, just no need to start from scratch.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Extract values from string

    This VBA code should work on Windows:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  4. #4
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Extract values from string

    Thank you WBD!

  5. #5
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Extract values from string

    WBD,

    Actually, there is a little "twist" to it:
    There are instances when the string in the cell contains numerical values before the "/" sign like:
    PL-01 / Plywood / 4 mm / 46" x 118"
    The “/“ sign might occur multiple times.
    I need to revise the script to only parse what is after the last "/" sign.
    Could you please advise?
    Thans
    Last edited by plans; 06-29-2022 at 01:33 PM.

  6. #6
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Extract values from string

    Try like this then:

    Please Login or Register  to view this content.
    WBD

  7. #7
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Extract values from string

    Yes!, thanks!

+ 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. NUMERIC string - extract values
    By danju in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-03-2021, 02:25 PM
  2. [SOLVED] Extract numeric values from the string
    By ABSTRAKTUS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-02-2020, 06:38 AM
  3. [SOLVED] Extract unique values based on first 5 characters in the string
    By ABSTRAKTUS in forum Excel General
    Replies: 3
    Last Post: 10-14-2019, 10:03 AM
  4. Extract values from long string
    By s@skia in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 03-13-2014, 12:32 PM
  5. Parse & extract multiple recurring values from a string
    By AaronLyles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2011, 01:03 PM
  6. Extract Values and percentages from text string
    By Andy748 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2007, 05:56 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