ich möchte in meiner Formel prüfen, ob sich das Ergebnis geändert hat.
Dadruch habe ich selbstverständlich einen Zirkelbezug, der sich aber nicht auf die Berechnung auswirkt, was Excel aber nicht interessiert.
z.B.
Zelle A1: 1
Zelle A2: 2
Zelle A3: =test(A1; A2; A3) bzw. =test(A1; A2)
Public Function test(intA1 As Integer, intA2 As Integer, intA3 As Integer) As Integer
test = intA1 + intA2
If intA3 > 0 And intA3 test Then
MsgBox "Wert hat sich geändert"
End If
End Function
Alternative:
Public Function test2(varA1 As Variant, intA2 As Integer) As Integer
Dim intA1 As Integer, intTmp As Integer, intSpalte As Integer
Dim varTmp As Variant
intA1 = CInt(varA1.Text)
intSpalte = varA1.Column
varTmp = Cells(3, intSpalte)
intTmp = CInt(varTmp)
test2 = intA1 + intA2
If intTmp > 0 And intTmp test2 Then
MsgBox "Wert hat sich geändert."
End If
End Function
---> Als Ergebnis bekomme ich immer 0.
Wie kann ich mein Wunsch verwirklichen? :)
LG
Andi