+ Reply to Thread
Results 1 to 13 of 13

Comparison 1 vs 2,3,4,5,6

  1. #1
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Comparison 1 vs 2,3,4,5,6

    I see others needing comparison betweens rows or columns. I also see compare of 2 sheets or files.
    Not sure which would work for what I want/need.

    I have sheet1/file1 that I need to compare to sheet2/file2, 3, 4 and etc.
    I was thinking if data from file1/sheet1 doesn't have a match with any than I would get a msgbox.

    So is there a function for comparison or just use macro?
    I have example I would like to have added. Example is only has 5 data. I want something that would be less coding as if I have 100 data.
    comparison.xlsx

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Comparison 1 vs 2,3,4,5,6

    Hello EXLent,

    To help you with this problem, you would need to post your actual workbook. We need to see how the data is arranged, what formulas you are using, etc. Otherwise, we are just guessing at what you need.

    Please provide before and after examples of your data along with any notes you would like to include.

    If your workbook contains any sensitive information, please redact that information before you post.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: Comparison 1 vs 2,3,4,5,6

    Well, that's the issue that I have. I need to know how before I can start one.
    The attached was example how I wanted to work like.

    I will have 6 xls files(1 compare to 5). With coding would be 6xls+1xls=7 files total.

    I will be coding 7.xls to compare/match
    1.xls to 2.xls
    1.xls to 3.xls
    1.xls to 4.xls
    1.xls to 5.xls
    1.xls to 6.xls

    user will have all xls open and click on a button to run macro in 7.xls. When there's a match, it will mark(X) on appropriate cell. As shown on example file.

    Or

    I can grab data from xls file and input column A(1.xls),B(2.xls),C and etc.
    and compare the columns. Not sure which is easier to understand or shorter in code.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Comparison 1 vs 2,3,4,5,6

    Hello EXLent,

    I am not sure which columns of which worksheet you want to compare.

    Will case matter when comparing the data?

  5. #5
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: Comparison 1 vs 2,3,4,5,6

    no, I just want to see coding and take it from there and edit it.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Comparison 1 vs 2,3,4,5,6

    Hello EXLent,

    I can write a macro that compares column "A" of the first sheet in each workbook against column "A" in the 7th workbook.

    Is that something you can use?

  7. #7
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: Comparison 1 vs 2,3,4,5,6

    Yep, that should work and I can take it from there.

  8. #8
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: Comparison 1 vs 2,3,4,5,6

    Kinda want something like this.

    Compare cell A2 of 1.xls to column A of 2.xls, if Yes, X on B2 in 1.xls. If No, next cell. If yes, X on C2 in 1.xls

    Does that make sense?

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Comparison 1 vs 2,3,4,5,6

    Hello EXLent,

    So the Workbook names would be in row 1 and the data to compare in Column "A" of "7.xls" ?

  10. #10
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: Comparison 1 vs 2,3,4,5,6

    Here's all the files to explain better.
    2.xlsx
    1.xlsx
    3.xlsx
    7.xlsm

  11. #11
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: Comparison 1 vs 2,3,4,5,6

    saw a posting with something like this =IF(ISERROR(MATCH(A1,$B:$B,0)),0,"Match")
    but not sure what it really does.

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Comparison 1 vs 2,3,4,5,6

    This macro will use the data in "1.xlsx" and fill in the table on "Sheet1" of "1.xlsx". The column headers are the file names.

    The macro assumes you know the names of the xlsx files that are open. The Select Case statement is where the names are entered.

    This macro can be placed in another workbook and run.

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: Comparison 1 vs 2,3,4,5,6

    what does this mean?
    "Object variable or with block variable not set"?
    \1
    Attached Images Attached Images
    Last edited by EXLent; 10-27-2014 at 11:29 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Comparison
    By Mike in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 03:05 PM
  2. Comparison
    By Mike in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM

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