vba help - Extract invoices from a string

Mallesh23

Well-known Member
Joined
Feb 4, 2009
Messages
976
Office Version
  1. 2010
Platform
  1. Windows
Hi Team,

Column A is Unstrcutured Invoices. Column B is expected output.

The Criteria to extract Invoice no in Column B is Account Code in Column D.

Find the 3 digit account code in a string. It should Begin with 3 digit numerical value.

This 3 digit account code will be
after a string or special charecter.
Before a string or special charecter.

if account code comes middle of a string , dont pick that no as Invoice no.

ex - 7003157000


Attached are my sample Table with expected output
Also attached snapshot highlighting account code.

Book3
ABCD
1Invoice Actual DataExtracted InvoicesAccount Code - Criteria List
25300000798-PIF-PR/64464645300000798530
3D-E-D7350001120 RW BAL7350001120735
45100000182-Bal-201916155100000182510
5D-PR-10967-315000492H315000492315
6F-W-10713-3150004797&323150004797635
72333-RW-4400000176-P-622
862001105926200110592780
9ST7800000292-8451-P\44446357800000292365
10635011186 - 10 - p635011186600
11F-W-10488-31500047003150004700565
12-
135650000606 fnl pmt S5650000606
14refu25188/6000000502AH\5646446000000502
Sheet1



Thanks in advance,
mg
 

Attachments

  • Snapshot with highlighted account code.PNG
    Snapshot with highlighted account code.PNG
    18.8 KB · Views: 5
Last edited:

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Nothing is going to happen here unless you can provide some sort of consistent "decryption" key to be able to extract the information you need from the given "Invoice Actual Data". Speaking only for myself, I cannot discern any pattern in your data conversion even with your explanation.
 
Upvote 0
Hi igold,

Agree with you its Challenging, 100% Accuracy is not possible. I am ok if I get 90% accuracy , Remaining I will check with Manually.

plz refer snapsot where I have highlighted in Red.



Thanks
mg
 

Attachments

  • Snapshot with highlighted account code.PNG
    Snapshot with highlighted account code.PNG
    18.8 KB · Views: 2
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top