troubleshooting Question

Excel VBA extracting value from a text string with inconsistent formatting

Avatar of Jase Alexander
Jase AlexanderFlag for United Kingdom of Great Britain and Northern Ireland asked on
VBAMicrosoft ExcelMicrosoft Office
3 Comments2 Solutions224 ViewsLast Modified:
Hey Guys
Hope you can help
Is there a way to search within a text statement for part of the string that contains a number or specifically, in this case, a value?
We have a system that has a comments section and in this section, the user posts a comment (manually however the date is auto-created) that basically details payment approval, invoice reference with its quantity and value. This comments is then pulled from our system into an Excel worksheet against the relevant record.
My only issue is that the statement isn’t always consistent in terms of the formatting and spacing between each section, and although going forward, I have managed to standardise the way in which this has been posted, historically I need to extract certain data from these posts to assist in automating a linked process.
Please see some examples below taken from our system that shows the inconsistency in posting:-
09/06/2016 – Approved for payment         invoice number YC1564
      Pieces : 5416                                  Value : $57146,54

10/10/2016 – Approved for payment           invoice ref 1657/SS13
                 Pieces : 10142                                 Value : £4213.06

09/01/2017 – Approved for payment           Invoice no. 11312/JCB
                   Pieces : 500                                Value : 324.01 EUR

What I need is to extract the figure entered after the Value label (the currency etc is not an issue) – is this possible via a formula or VBA considering the format is not always the same? For example, for the first comment above, the result would be 57146.54.
If the whole comment is held in Cell A1 for example, what could I put into Cell P1 to extract this data? I have attached a really basic file to show how the comments is situated within the worksheet (albeit in a different location)
Your suggestions, as always, would be extremely welcome

J
EE_Example.xlsx
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros