+ Reply to Thread
Results 1 to 20 of 20

Need Macro to find match for invoices. With the Amount

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Need Macro to find match for invoices. With the Amount

    Hi I have a problem.
    In The column A i have the pasted invoice numbers.
    In column B I have the amounts which match the invoices(A2 invoice = B2 Amount etc )

    In column D i have some search result amounts. In this case 4 amounts.

    I can manually find which Amounts in Column D match which invoices.(A2 invoice = B2 Amount etc )
    ( Have done that in Column H and I)

    I need a macro which can do this automatically.
    So it make the result which i have done manually in column H and I.

    In the teori there could be 100 Invoices and Amounts in Column A and B
    And also in the teori there could be and result with many amounts in Column D.

    Please have a look at the test file i send and see if you have a solution.

    Thanks In advance

    Abjac
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need Macro to find match for invoices. With the Amount

    you can solve with VLOOKUP function, but you have to convert numbers to text, see attached
    Attached Files Attached Files
    Last edited by patel45; 11-17-2012 at 01:01 PM.
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need Macro to find match for invoices. With the Amount

    Hi abjac

    With code try this
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need Macro to find match for invoices. With the Amount

    Hi Thanks to both of you. The 2 codes are i think identically, but both are working like a charm. So thank you alot. I really appriciate this.

    Have a nic day

    Abjac

  5. #5
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need Macro to find match for invoices. With the Amount

    HI If you have time i have a new thread.
    Need Input to working Solver Macro
    Try to look at this one.

    Abjac

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need Macro to find match for invoices. With the Amount

    Hi jaslake
    why do you use Replace(cel, ".", ",") ?

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need Macro to find match for invoices. With the Amount

    @patel45

    Column D is formated -542.12 (with a . (dot))
    Column C is formated -542,12 (with a comma)

    So the code replaces the . (dot) with a comma to do the Find.

  8. #8
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need Macro to find match for invoices. With the Amount

    columns C D have the same format on my downloaded test1.xls

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need Macro to find match for invoices. With the Amount

    @patel45

    When I open the file(s) attached to this Thread Columns D and C are formated as I described.

  10. #10
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need Macro to find match for invoices. With the Amount

    I asked you because, if I remove replace function, the code doesn't work, replace convert number to string

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need Macro to find match for invoices. With the Amount

    @patel45

    You are correct
    if I remove replace function, the code doesn't work
    If you remove the replace function the code is looking for Column D -542.12 (with a . (dot) in Column C -542.12 (with a . (dot) and doesn't find it.

    In Column C it's -542,12 (with a comma).

  12. #12
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need Macro to find match for invoices. With the Amount

    No jaslake, on my wb there is a comma on column C and D, see attached image
    Attached Images Attached Images

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Need Macro to find match for invoices. With the Amount

    @patel45

    Can't imagine why we're not seeing the same data.

  14. #14
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need Macro to find match for invoices. With the Amount

    Hi Guys. I found a error in this. In only a search for 4 invoices out of 5 invoices. Please have a look at below file. One invoice is wrong.And i cant figure out why. Please have a look

    Thanks in advance

    Abjac
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need Macro to find match for invoices. With the Amount

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need Macro to find match for invoices. With the Amount

    HI Patel It helped on the first error. But it make a new one. In this test3 excel i have put the old code and the new code in 2 modules. The problem with the new code is, If there is 2 invoices with the same amount, it show same invoice number when it match.

    But the old one its ok. But then it have the old error from before.

    Try have a look at this one. And maybe compare with the old test2 excel file.

    Thanks in advance

    Abjac
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need Macro to find match for invoices. With the Amount

    HI Patel and others I will show you what i am playing with now. Its a part of the problem with the match also.
    In Below excel file i have a search option for finding matching invoices with the amount.The code is made by a german in 2002, who won an award for this code ( Michael Schwimmer). I have tried to change it from German to english.
    In the other excel file (Invoices and amounts) you can see what i want to search for.

    I paste the amounts into sheet2 column A
    I paste the invoices into Sheet 2 column H
    Then i type in the amount to search for in Sheet2 column B, I press search and the result come in Sheet 2 column D.
    So far so good. When i searhc for this amount(1138256,38) it find it right away. But with the other amount it get stock.
    So i think his code need some input for example time, or error and also maybe some textboxes.
    After i find the result i press in Sheet 1 Copy found values to Sheet 3.
    And after that i can press Find mathcing invoices with amount.
    And this is here we are now also. It give me problem. The one you have tried to help me with.
    I will paste both excel files. And will be happy if you or others can have a look on them. And come with some suggestions, how to make the search work better or correct and also the match for invoices need to be better.

    Please have a look at the files here below.

    Thanks in advance
    Attached Files Attached Files

  18. #18
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Need Macro to find match for invoices. With the Amount

    I am confused, 2 files, many modules, attach only what is essential to understand and test

  19. #19
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need Macro to find match for invoices. With the Amount

    Hi Patel I have tried to make it more simple. The file test is only with the numbers, you shall searchwith.

    In excel file FindSum ENG1.xls, you start in sheet2. Paste amounts in column A and Invoice numbers in column H.
    You press Button(Sheet2) "Press to search for Match.The result comes in column D
    Then you go Sheet1 and press button "Copy found values to Sheet3"
    You check in Sheet3.
    Go back to Sheet1 press the button "Find Matching invoices with Amounts"
    The resul should now come in Sheet3 Column H and I.
    Here is the new files you can check.
    One with the numbers for search excel file "Testnumbers.xls.
    And the program excel file "FindSum ENG1.xls"
    Hope it more easy now.

    Thanks in advance

    Abjac
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Need Macro to find match for invoices. With the Amount

    Hi Patel. Did you give up on this one or still trying. Hope you can have time for a look.

    Thanks

    Abjac

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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