Compare two Excel tables

datatable
excel
activities

#1

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


#2

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


#3

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.


#4

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)


#5

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

Regards
Balamurugan


#6

The code has you select your own files.