+ Reply to Thread
Results 1 to 12 of 12

Compare 2 Inventory Worksheets, Then Create Changes Worksheet

  1. #1
    Registered User
    Join Date
    01-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    Hi Everyone,

    I have two inventory worksheets (within the same workbook), from different months, that I need to compare and see what has increased and decreased. Normally I work with 300-400 rows of items, though I have included a sample of 5 rows here.

    I would like to compare the two inventories, find what positions have changed and then list those changes (amount of increase of decrease) on a third worksheet. Ideally, I would like a macro that would use the unique ID from Column A to match between worksheets, then determine what the change in inventory amount from column E is (positive or negative). If the description, version and expire date information from Column B,C & D could be included on the third (Changes) worksheet, that would be great.

    It has been a while since I have used macros and VBA, though I am comfortable with using them (and a little excited to use them again, and save some time too). Thank you in advance and please let me know if there is anything else you need from me.

    Thanks again,
    Dex
    Attached Files Attached Files
    Last edited by Dex; 01-04-2011 at 02:58 PM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    hi, what to do if id is absent and what sheet is the base for compare

  3. #3
    Registered User
    Join Date
    01-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    Quote Originally Posted by watersev View Post
    hi, what to do if id is absent and what sheet is the base for compare
    There are no blanks in the columns being compared (ID in column A, and Amount in Column E).

    I would like to use the unique ID in Column A (in both Nov & Dec worksheets) as the base to compare, then see what the differences in Amount in Column E is.

    Thanks for the help.

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    ok, can you please also post the result sheet you'd like to get as a result (basing on your sample data)

  5. #5
    Registered User
    Join Date
    01-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    The result sheet has been included in the xls file in my original post.

    Thanks for reminding me to include it!

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    see attachment

    Preparation to run macro "Compare":

    1. [Alt+F11] - open Visual Basic window
    2. Tools - References - find and tick "Microsoft Activex Data Objects 2.0 Library"
    3. Press "Ok"
    4. Close Visual basic window
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    Thank you very much watersev!

    How would I go about expanding the macro to work with the larger inventory (with almost 400) line items?

    Thank you again!

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    it is working for 65500 rows (you can check that in the code, it's very small)

  9. #9
    Registered User
    Join Date
    01-03-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    You are correct and that works flawlessly with the full inventory! Thank you very much!

  10. #10
    Registered User
    Join Date
    12-02-2011
    Location
    Illinois
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    3

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    I tried to run this macro in Excel 2003 but I’m getting the following error:
    “Run-time error ‘-2147217865 (80040e37)’:
    The Microsoft Jet database engine could not find the object ‘Dec 31$A2:E65500’. Make sure the object exists and that you spell its name and the path name correctly.

    Is there something I need to change?

    Thank you

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    alsacaju,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  12. #12
    Registered User
    Join Date
    12-02-2011
    Location
    Illinois
    MS-Off Ver
    Excel 2003 & Excel 2007
    Posts
    3

    Re: Compare 2 Inventory Worksheets, Then Create Changes Worksheet

    oops!! sorry...

+ 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