Created
September 8, 2022 07:43
-
-
Save Winand/37ff8c09b626df2b52df1cbe5e2f2fd6 to your computer and use it in GitHub Desktop.
Сравнение книг Excel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub compare() | |
Dim sh1 As Worksheet, sh2 As Worksheet | |
Set wb1 = ThisWorkbook | |
Set wb2 = Workbooks("Map B00 XP__20210617_.XLSX") | |
For Each sh1 In wb1.Worksheets | |
Set sh2 = wb2.Worksheets(sh1.Name) | |
If sh1.UsedRange.Address <> sh2.UsedRange.Address Then | |
Debug.Print sh1.Name | |
Else | |
For Each c In sh1.UsedRange | |
If c.Value <> sh2.Cells(c.Row, c.Column) Then | |
Debug.Print sh1.Name, c.Address | |
End If | |
Next c | |
End If | |
'Debug.Print sh1.Name, sh1.UsedRange.Address, sh2.UsedRange.Address, sh1.UsedRange.Address = sh2.UsedRange.Address | |
Next sh1 | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment