I think this is what you're missing:

VB Code:
  1. Dim TheTotal1 As Double, TheTotal2 As Double
  2.  
  3.  
  4. 'to run the code in the background
  5. Application.ScreenUpdating = False
  6.  
  7. 'to compare sum of the 2 ranges
  8. TheTotal1 = Application.WorksheetFunction.Sum(Sheet1.Range("A5:A10"))
  9. TheTotal2 = Application.WorksheetFunction.Sum(Sheet2.Range("A5:A10"))
  10.  
  11. If TheTotal1 = TheTotal2 Then
  12. (your code)
  13. End If
  14.  
  15. 'you have to turn it back to true
  16. Application.ScreenUpdating = True