
Option Explicit
Sub check()
Dim cella As Range, valore_foglio1 As Integer, sum_valori_foglio2 As Integer, evaluate_string As String
For Each cella In Foglio1.[A1:A10]
If cella = "" Then Exit For
valore_foglio1 = cella.Offset(, 1)
evaluate_string = "SUMIF(foglio2!A1:A10, " & Chr(34) & cella & Chr(34) & ", foglio2!B1:B10)"
sum_valori_foglio2 = Evaluate(evaluate_string)
If valore_foglio1 = sum_valori_foglio2 Then cella.Offset(, 2) = "coincide!"
Next
End Sub |
