I think this is what you're missing:
VB Code:
Dim TheTotal1 As Double, TheTotal2 As Double 'to run the code in the background Application.ScreenUpdating = False 'to compare sum of the 2 ranges TheTotal1 = Application.WorksheetFunction.Sum(Sheet1.Range("A5:A10")) TheTotal2 = Application.WorksheetFunction.Sum(Sheet2.Range("A5:A10")) If TheTotal1 = TheTotal2 Then (your code) End If 'you have to turn it back to true Application.ScreenUpdating = True




Reply With Quote