Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub CheckMySheets()
Dim wb As Workbook
Dim ws1 As Worksheet 'orig sheet1
Dim ws2 As Worksheet 'orig sheet2
Dim ws3 As Worksheet 'new worksheet
Dim ws4 As Worksheet 'new worksheet
Dim x As Long 'row
Dim y As Integer 'column
Dim v3 As Variant 'value from sheet3
Dim v4 As Variant 'value from sheet4
Set wb = ActiveWorkbook
Set ws1 = wb.Worksheets(1)
Set ws2 = wb.Worksheets(2)
ws1.Copy , ws2
Set ws3 = wb.Worksheets(ws2.Index + 1)
ws2.Copy , ws3
Set ws4 = wb.Worksheets(ws3.Index + 1)
ws3.Name = "ws1Compare"
ws4.Name = "ws2Compare"
ws3.Select
For y = 1 To ws3.Range("IV2").End(xlToLeft).Column
DoEvents
For x = 1 To ws3.Range("A65000").End(xlUp)
DoEvents
v3 = ws3.Cells(x, y)
ws4.Select
v4 = ws4.Cells(x, y)
Debug.Print v3 & " ---- " & v4
If v3 = v4 Then
'If same, do nothing
Else
'If different, highlight items
'ws3.Select
'ws3.Cells(x, y).Select
ws3.Select
ws3.Cells(x, y).Select
ws3.Cells(x, y).Interior.ColorIndex = 4
ws4.Select
ws4.Cells(x, y).Select
ws4.Cells(x, y).Interior.ColorIndex = 4
End If
Next x
Next y
If ws3 Is Nothing Then Else Set ws3 = Nothing
If ws2 Is Nothing Then Else Set ws2 = Nothing
If ws1 Is Nothing Then Else Set ws1 = Nothing
If wb Is Nothing Then Else Set wb = Nothing
End Sub
Differ in what respect? VALUES or FORMATS or BOTH or something else?and highlight where they differ