+ Reply to Thread
Results 1 to 6 of 6

Break out numerical values from a string

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

    Break out numerical values from a string

    Hello,
    My data is written in the following format:
    "numerical value" & "minus sign" & "numerical value", like
    25-120
    or
    2-8
    etc.
    I need a macro which returns the two numerical values (one on the left of the "minus sign" and the other, from the right of the "minus sign" like:

    25
    120

    or

    2
    8

    Please advise,
    Thank you!

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Break out numerical values from a string

    Suppose 25-120 in A1
    Put this formula in B1
    Please Login or Register  to view this content.
    and this formula in C1
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Break out numerical values from a string

    And if you would like to use VBA you can try
    Please Login or Register  to view this content.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Break out numerical values from a string

    Or this maybe.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

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

    Re: Break out numerical values from a string

    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,516

    Re: Break out numerical values from a string

    plans,

    Thanks for the rep.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. [SOLVED] How to convert string to numerical value
    By Alan3285 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-14-2016, 01:05 AM
  2. Assign numerical values to string
    By mjv008 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2016, 02:32 PM
  3. trying to break a string of values from one cell to two
    By sirgeoff in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2015, 11:36 AM
  4. Search for a numerical value in the string
    By simasemail in forum Excel General
    Replies: 6
    Last Post: 11-27-2014, 05:26 PM
  5. How to generate a string of text, based on numerical values defined in sheet
    By fleshbug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2013, 06:04 PM
  6. Converting string to numerical value
    By tdh885 in forum Excel General
    Replies: 2
    Last Post: 05-14-2007, 07:54 AM
  7. separate the numerical values in a string
    By nebrass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-24-2006, 08:55 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