ciao
utilizziamo la funzione Sum() di excel
modifica alle tue due sub()
Sub SommaVerticale()
Dim x, y, w, tot
tot = Cells(7, 19)
Range("X7:AB17").Interior.Color = RGB(152, 218, 152)
For x = 24 To 28
For y = 7 To 17
For w = y + 1 To 17
If Application.Sum(Cells(y, x), Cells(w, x)) = tot Then
Cells(y, x).Interior.ColorIndex = 2
Cells(w, x).Interior.ColorIndex = 2
End If
Next w
Next y
Next x
End Sub
Sub SommaOrizzontale()
Dim x, y, w, tot
tot = Cells(7, 19)
Range("L7:P17").Interior.Color = RGB(152, 218, 152)
For x = 7 To 17
For y = 12 To 16
For w = y + 1 To 17
If Application.Sum(Cells(x, y), Cells(x, w)) = tot Then
Cells(x, y).Interior.ColorIndex = 2
Cells(x, w).Interior.ColorIndex = 2
End If
Next
Next
Next
End Sub
riallego il tuo file corretto
[Modificato da locatevaresino 16/03/2020 18:20]
Ciao da locate
excel 2007 / 13