+ Reply to Thread
Results 1 to 7 of 7

A macro to identify data items not present in one of two sheets

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Latvia
    MS-Off Ver
    Excel 2k7
    Posts
    5

    A macro to identify data items not present in one of two sheets

    Hi all,

    This is my first post here.

    There is a problem that I have been trying to solve for quite some time now, but haven’t quite hit it yet.

    Problem description:
    I am working with the financial accounting for multiple companies. There is a task I perform where I have to identify invoices which are not booked in one company or another.

    There are two sheets of data, one is the payable side of Company 1, other is the receivable side of Company 2. A sample file is attached.

    My aim is to create a macro that helps to determine which invoices (in this case 200023 abc6 2000) are not booked in the payable side of Company 1.
    It would be perfect if a new sheet would be created where a list of invoices not found in Company 1 is given.


    Could you please help me? Appreciate your help and attention.


    example.xlsx

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: A macro to identify data items not present in one of two sheets

    Does it have to be a macro?

    Company 2:D2
    =IF(ISNA(VLOOKUP(Table1[[#This Row],[Invoice number]], 'Company 1'!A:C, 3, FALSE)),"Not Found", "Found")

    If you still have your heart on a macro, what info do you want on the new sheet? Just the invoice number?

    Please Login or Register  to view this content.
    Last edited by Tinbendr; 07-25-2012 at 09:09 AM.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    07-24-2012
    Location
    Latvia
    MS-Off Ver
    Excel 2k7
    Posts
    5

    Re: A macro to identify data items not present in one of two sheets

    Thanks a lot Tinbendr!

    The new sheet would ideally contain all columns for the missing invoices.

    Your macro returns these results:
    Invoice
    2845893118
    3237675073
    200023

    How come?

    Also, say I have 6 companies that have to be reconciled both ways Comp 1 AR with Comp 2 AP and Comp 2 AR with Comp1 AP.
    It would be perfect to have all missing invoices for all companies shown in that one new sheet. Is that even possible?

    Thanks and best regards,

    Gustavs

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: A macro to identify data items not present in one of two sheets

    Quote Originally Posted by MrGustavs View Post
    Your macro returns these results:
    Invoice
    2845893118
    3237675073
    200023

    How come?
    It has something to do with format. You'll notice that there is only a whole number displayed, but if you look in formula bar, it shows a .4 or .6 decimal after the account number. If I take the format out, it works correctly.

    We're gonna need an expert to explain that one.

    It would be perfect to have all missing invoices for all companies shown in that one new sheet. Is that even possible?
    Are they in different sheets? If so, we'll have to hard code the names. Create an array of the paired names.

    New code to include all columns.
    Please Login or Register  to view this content.
    Last edited by Tinbendr; 07-25-2012 at 11:31 AM.

  5. #5
    Registered User
    Join Date
    07-24-2012
    Location
    Latvia
    MS-Off Ver
    Excel 2k7
    Posts
    5

    Re: A macro to identify data items not present in one of two sheets

    Sorry for the delayed answer.

    Yes, well, actually there are 6 sheets with pivots in them. The pivots are using data which is imported from the accounting software database from time to time.
    By clicking on the pivots I get the payables data from 1 company with and the receivables data from the other company.

    These are the pairs that have any active transactions between them (and thus data to have to check)

    01 with 02
    with 03
    with 04
    with 05
    with 40
    02 with 03
    with 04
    with 05
    03 with 04
    with 05
    04 with 05

    I am sure it would be a lot faster to explain if I just attached a sample file, but I am not sure I am allowed to do that.

    So the macro would:
    Select the correct data arrays from the pivot (even with the pivot being changed time to time)
    check which invoices are not booked in which side.

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: A macro to identify data items not present in one of two sheets

    Quote Originally Posted by MrGustavs View Post
    I am sure it would be a lot faster to explain if I just attached a sample file, but I am not sure I am allowed to do that.
    You can. Go Advanced, scroll down a little until you see Manage attachments.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: A macro to identify data items not present in one of two sheets

    To Attach a File:

    1. Click on Go Advanced (below the Quick Reply area)
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.

+ 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