Comparing worksheets in excel
Closed
Hannah
-
Nov 21, 2014 at 07:03 AM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Nov 21, 2014 at 11:31 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Nov 21, 2014 at 11:31 PM
Related:
- Comparing worksheets in excel
- Number to words in excel - Guide
- Transfer data from one excel worksheet to another automatically - Guide
- Gif in excel - Guide
- Marksheet in excel - Guide
- How to take screenshot in excel - Guide
1 response
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Nov 21, 2014 at 11:31 PM
Nov 21, 2014 at 11:31 PM
Hello Hannah,
I have (well, actually my wife uses it where she works!) the following code which may help you:-
Wherever in the code you see Sheet1 or Sheet2, change it to suit your spread sheet tab names. The color index number you can change to suit yourself.
I hope this helps.
Regards,
vcoolio.
I have (well, actually my wife uses it where she works!) the following code which may help you:-
Sub RunComparison()
Call SheetComparison("Sheet1", "Sheet2")
End Sub
Sub SheetComparison(Sheet1 As String, Sheet2 As String)
Dim cell As Range
Dim diff As Integer
For Each cell In ActiveWorkbook.Worksheets(Sheet2).UsedRange
If Not cell.Value = ActiveWorkbook.Worksheets(Sheet1).Cells(cell.Row, cell.Column).Value Then
cell.Interior.ColorIndex = 8
diff = diff + 1
End If
Next
MsgBox diff & " differences found", vbInformation, "Check Differences"
ActiveWorkbook.Sheets(Sheet2).Select
End Sub
Wherever in the code you see Sheet1 or Sheet2, change it to suit your spread sheet tab names. The color index number you can change to suit yourself.
I hope this helps.
Regards,
vcoolio.