We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Option Explicit Public Sub CompareData() 'compares Today and Yesterday named ranges Dim rngToday As Range Dim rngYesterday As Range Dim rngTcell As Range Dim boolFirstTime As Boolean Set rngToday = ActiveSheet.Range("Today") Set rngYesterday = ActiveSheet.Range("Yesterday") If (rngToday.Columns.Count = rngYesterday.Columns.Count) _ And (rngToday.Rows.Count = rngYesterday.Rows.Count) Then Else MsgBox "Sophis Fiscal are Identical!", vbCritical, "Range size difference" Exit Sub End If boolFirstTime = True For Each rngTcell In rngToday If rngTcell.Value <> rngYesterday.Cells(rngTcell.Row - rngToday.Row + 1, rngTcell.Column - rngToday.Column + 1).Value Then Else If boolFirstTime Then boolFirstTime = False 'skip header cell Else Exit Sub End If End If Next MsgBox "Data Identical", vbCritical, "Range Data Identical" End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.