+ Reply to Thread
Results 1 to 6 of 6

Retrieve amount from string in VBA

  1. #1
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Retrieve amount from string in VBA

    Hi, this is driving me nuts...

    In VBA I need to add up values from a Range: oRng with:

    Please Login or Register  to view this content.
    oRng has a series of cells with string values like: "notimportant € 8,50", or "notimportant € 637,00"
    I need to add up the amounts at the right of each value. There is a space between the € and the amount, so I need to add up everything right from the space, but there is a " , " in the string value as a decimal (European number style).

    My question: How can I retrieve the ExtractedValue from these strings?

    Thx.

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

    Re: Retrieve amount from string in VBA

    Try this
    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 Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Retrieve amount from string in VBA

    Thanks so much YasserKhalil,
    It works perfectly, although I have no idea what this part of your solution means: Val(Split(s, "€")(UBound(Split(s, "€"))))
    Last edited by ArnolddG; 12-08-2018 at 11:25 AM.

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

    Re: Retrieve amount from string in VBA

    May be these comments help you

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Retrieve amount from string in VBA

    OK, I get it. Thanks for explaining to me.
    This helpt a lot...

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

    Re: Retrieve amount from string in VBA

    You're welcome. Glad I can offer some help

+ 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. How to retrieve data from another column next to the string you search for.
    By ESEKOCK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2018, 03:33 PM
  2. Different way to retrieve numbers a text string.
    By jonagpa in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 01-21-2016, 06:37 PM
  3. [SOLVED] Search for a string and retrieve string from an adjacent cell.
    By djt80 in forum Excel General
    Replies: 5
    Last Post: 01-27-2015, 03:57 PM
  4. How to retrieve second to last letter of a string
    By ltg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-05-2008, 11:33 AM
  5. Retrieve Weekday from String
    By rasak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2008, 04:00 PM
  6. [SOLVED] VB.Net - retrieve actual formula string
    By Grant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2006, 01:20 PM
  7. [SOLVED] How do I retrieve the text string from the right of a cell
    By JWG in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-08-2006, 10:35 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