Compare Two Excel files & Highlight Differences

Mohammednt0
4StarLounger
Posts: 456
Joined: 05 Dec 2016, 13:48

Compare Two Excel files & Highlight Differences

Post by Mohammednt0 »

good day

i need a vba code to compare these 2 excel files sheet by sheet, cell by cell, & highlight differences

so sheet one from file one should be compared with sheet 1 from file two.
sheet 2 from file one should be compared with sheet 2 from file two.
sheet 3 from file one should be compared with sheet 3 from file two.

and so on ...


thanks in advance, and sorry for the hassle.
Last edited by Mohammednt0 on 07 Mar 2023, 07:02, edited 1 time in total.

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Compare Two Excel files & Highlight Differences

Post by HansV »

Do you have Office Professional Plus, or Microsoft 365 for Enterprise? If so, you have an Office tool named Spreadsheet Compare.

S2312.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Compare Two Excel files & Highlight Differences

Post by HansV »

Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Compare Two Excel files & Highlight Differences

Post by ChrisGreaves »

HansV wrote:
05 Mar 2023, 14:02
Third-party tools:
Hi Hans.
Do any of these tools do a full compare, or are they only a cell-by cell comparison?
I ask because a spreadsheet can be decomposed into a two-column format, generally with labelled data input cells in the top rows, labelled intermediate calculation coming in further down, and what is called the bottom-line results appearing near the bottom line.

This follows from our determination that a spreadsheet must not have a circular reference; that is, it must show a linear dependency.

This deeper level of analysis can detect identical spreadsheets that have been somewhat obfuscated.
Cheers, Chris
An expensive day out: Wallet and Grimace

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Compare Two Excel files & Highlight Differences

Post by HansV »

I don't know, Chris, I haven't tried them myself.
Best wishes,
Hans

Mohammednt0
4StarLounger
Posts: 456
Joined: 05 Dec 2016, 13:48

Re: Compare Two Excel files & Highlight Differences

Post by Mohammednt0 »

i used this tool and it worked great, thanks for the tip

https://sourceforge.net/projects/spreadshcompare/