+ Reply to Thread
Results 1 to 8 of 8

Reconciliation

  1. #1
    Registered User
    Join Date
    08-30-2005
    Posts
    67

    Reconciliation

    Hi Folks,

    I need some expert advise in how to develope a macro function to reconcile some lines that correspond to some criteria.

    The example attached will give you some idea of what I am talking about. I need to find a simple and quick way to remove from this table the lines where "Supplier" AND "Invoice" values are the same AND the sum of "Amount" is equal to zero.

    Filtering it is laso a solution. But it's not very practical when you have a list of 1,000 different suppliers.

    Much appreciate any advise.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    same?

    Hi
    Your workbook does not show any same supplier & invoice except probably A & 123-A. how to handle negative amount.
    Ravi

  3. #3
    Registered User
    Join Date
    08-30-2005
    Posts
    67

    Additional clarification

    Quote Originally Posted by ravishankar
    Hi
    Your workbook does not show any same supplier & invoice except probably A & 123-A. how to handle negative amount.
    Ravi
    Hi Ravi,

    Sorry, maybe I was not very explicit in what should be the criteria for the lines to be removed.

    For instance you have supplier A mentioned in 3 different records: lines 2, 11, 12. But only line 2 and 12 have the same invoice number. And therefore they can be removed since the sum of Amount column for these 2 lines is zero.

    I’ve amended the table to indicate the lines that should be picked up by the macro and removed as they satisfy the criteria.

    Hope this makes it more clear now.

    Regards,
    Eduard
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    08-30-2005
    Posts
    67

    No solution?

    Anyone able to help me with this?

    I realize I might need to use LOOKUP or VLOOKUP functions but not quite sure how to do that.

    Thanks in advance for any feedback.

    Eduard

  5. #5
    Registered User
    Join Date
    08-30-2005
    Posts
    67

    Solution

    Hi,

    Just in case someone is interested I've found a kind of solution.

    Please Login or Register  to view this content.
    What this macro does is the following: creates 2 additional columns D and E. In column D I'm adding the invoice number to supplier name. In column E I'm entering SUMIF formula to add up the amounts in column C for which the supplier+invoice number is the same. Than it filters for the lines where this sum is zero. And deletes those lines. At the end it just displays a message that macro has been completed.

    I accept, this does not look very professional. But it is at least something. If anyone can help me improve it, will be much appreciated.

    Namely:
    1. I'm not very happy that after filtering for zero values macro selects the filtered records starting with E2. Is there a way to indicate that the selection should start from the first record with zero value? For instance in this particular case the first zero value was in E2 cell. What if that would be E4 in another case?
    2. How do I extend the formulas entered in D2 and E2 to the last row of the table?
    3. How do I include an information about the number of deleted records into the message box?

    Thanks in advance for any feedback.

    Eduard

  6. #6
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    modified macro

    Hi
    I have modified the macro to delete rows if the sum is zero. I notice a problem. C 12-X has 3 rows which gives zero on totalling. I get to delete only the last row. Try it. I will change codes based on your reply
    RAvi
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-30-2005
    Posts
    67

    Feedback to Ravi's macro

    Hi Ravi,

    It's a good start.

    What I would do first is remove that message box that displays the value of E1 cell. It's not very handy to press Ok button hundred times when you have a large table with 1,000 records. Let the macro run until the very end without users interference into the process.

    Second, the final result is not exactly what I'm trying to achiev. Like for instance in case of supplier C all 3 lines (4, 10, 13) have to be deleted as the invoice number is the same (12-X) for all of them and the sum of these lines is zero.

    I've attached another spreasheet which shows how the final table has to look like.

    Thanks and regards,
    Eduard
    Attached Files Attached Files

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by Eduard
    Hi Ravi,

    It's a good start.

    What I would do first is remove that message box that displays the value of E1 cell. It's not very handy to press Ok button hundred times when you have a large table with 1,000 records. Let the macro run until the very end without users interference into the process.

    Eduard
    The purpose of this Forum is to guide users, not offer complete solutions. You should at least attempt to understand & amend the code yourself! Start by deleting the fairly obvious line that displays the message box (msgbox)
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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