Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:03:06+00:00 2026-05-26T09:03:06+00:00

I have 3 excel spreadsheets with the same columns and (supposedly) the same data.

  • 0

I have 3 excel spreadsheets with the same columns and (supposedly) the same data. I need to line up all 3 documents and look for inconsistencies within the data. The data is server information at a data center and I would like the server location(row/cab) and Asset Tags to match horizontally for an easy view of differences between the 3 documents. If a document would be missing the server (No matching asset tag or location is empty) then I would want a blank line inserted in the other 2 documents showing that it is not present. Hopefully that all makes sense.

Here is the image of all 3 sheets put together. (ignore the colors)

Excel Image http://img833.imageshack.us/img833/2937/unledcco.png

Thanks for the help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:03:07+00:00Added an answer on May 26, 2026 at 9:03 am

    Here’s an ADO based solution using Excel and VBA. If you need more info about using ADO with Excel/VBA then try http://support.microsoft.com/kb/257819

    I’m going to assume that all three of your spreadsheets are in a single workbook and that they are named Sheet1, Sheet2 and Sheet3. Obviously adjust the code as necessary.

    To use ADO, go to the Visual Basic Editor (via the menus or via Alt–F11) and then via Tools > References (or its equivalent in later versions) add a reference to: “Microsoft ActiveX Data Objects 2.8 Library”

    I’m using the provider and connection string for Excel 2003 and earlier because that’s the version I have. For Excel 2007 and later, use these instead (replacing the filename of course):

    Provider=Microsoft.ACE.OLEDB.12.0

    Data Source=filename;Extended Properties=Excel 12.0 Xml;

    (NB you’ll often see “HDR=Yes” in connection strings but this is the default setting for Excel and thus can be omitted)

    Firstly we’ll create a master list of asset tags from the original three spreadsheets. Create a blank sheet and call it Sheet4 so that we have somewhere to put the list.

    In a normal module, add the following then run it:

    Sub master_list()
    
    Dim cn As ADODB.Connection
    Set cn = New ADODB.Connection
    
    With cn
        .Provider = "Microsoft.Jet.OLEDB.4.0"
        .ConnectionString = "Data Source=" & ThisWorkbook.FullName & ";" & _
            "Extended Properties=Excel 8.0;"
        .Open
    End With
    
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    
    rs.Open "SELECT [Asset Tag] FROM [Sheet1$] UNION SELECT [Asset Tag] FROM [Sheet2$] UNION SELECT [Asset Tag] FROM [Sheet3$];", cn
    
    With Worksheets("Sheet4")
        .Cells(1, 1).Value = "Master"
        .Cells(2, 1).CopyFromRecordset rs
    End With
    
    rs.Close
    cn.Close
    
    End Sub
    

    The UNION operator in SQL only returns distinct records so this query has given us a complete list of the asset tags in all three spreadsheets with no duplicates. I’ve used “Master” as the column name to prevent any ambiguity later on

    Now we need to combine the data from the three individual sheets with the master list. Create a new blank sheet and call that Sheet5. Now add and run the following:

    Sub compare_sheets()
    
    Dim cn As ADODB.Connection
    Set cn = New ADODB.Connection
    
    With cn
        .Provider = "Microsoft.Jet.OLEDB.4.0"
        .ConnectionString = "Data Source=" & ThisWorkbook.FullName & ";" & _
            "Extended Properties=Excel 8.0;"
        .Open
    End With
    
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    
    rs.Open "SELECT * FROM (([Sheet4$] LEFT JOIN [Sheet1$] ON [Sheet4$].[Master] = [Sheet1$].[Asset Tag]) " & _
        "LEFT JOIN [Sheet2$] ON [Sheet4$].[Master] = [Sheet2$].[Asset Tag]) " & _
        "LEFT JOIN [Sheet3$] ON [Sheet4$].[Master] = [Sheet3$].[Asset Tag];", cn
    
    Dim fld As ADODB.Field
    Dim i As Integer
    i = 0
    With Worksheets("Sheet5")
        For Each fld In rs.Fields
            i = i + 1
            .Cells(1, i).Value = fld.Name
        Next fld
    
        .Cells(2, 1).CopyFromRecordset rs
    End With
    
    rs.Close
    cn.Close
    
    End Sub
    

    That should hopefully give you the data from all three spreadsheets presented against a master list of asset tags. The column names will probably be a bit odd-looking (e.g. “Sheet1$.Asset Tag” etc) and all of the formatting will be lost but at least you can see which sheets are missing data

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a growing set of Excel spreadsheets none with the same data structure.
Our users have created MS-Excel spreadsheets which over time have evolved into fairly complex
I have an Excel Spreadsheet like this id | data for id | more
I have an Excel spreadsheet of data like: ColumnA ColumnB 33 11 25 5
Programs used: SQL Server 2000, Excel 2003 We have a table in our database
I have a macro that add hundreds of lines of data to an excel
I'm exporting data programatically from Excel to SQL Server 2005 using SqlBulkCopy. It works
I have the following data in an Excel Spreadsheet: A B C 1 b
I have a Excel spreadsheet that has two tabs, I have data on the
I am working for a client who gets data in Excel spreadsheets but wants

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.