Compare two Excel tables

How do I compare the column headings of one excel sheet to another?

Hi @rlwalters,

  1. Read the two xl sheet in two different datatable.
    2.Keep a do while loop with column index.
    3.Inside Loop check the tbl1.Columns(intCol).ColumnName = tbl2.Columns(intCol).ColumnName
    4.add string array the difference colum Name.

Regards
Balamurugan

1 Like

Thank you.

My issue now is that the spreadsheet may have duplicate column headers which is not allowed when reading in a data table with headers.

Here is the code that I finally used for comparing the headers. In my case the first spreadsheet is the template and only has the headers.

Spreadsheet Header Compare - Copy.zip (4.8 KB)

Hi @rlwalters,
Can you attach the xl files.It is missing.

Regards
Balamurugan

The code has you select your own files.