I am trying to code a solver in order to solve a 4 unknown equation. 2 of these unknown parameters must be either integers or an EXACT 1 decimal number (127.1 ; 127.2 ; 127.3...). I precise that i do not want to round the value, the solver has to find the exact value (not 127.1234 = 127.1).
the difficulty is on the Exact decimal number, I don't know how to set up this constraint. I have tried with a boolean function :
Function EstValide(Rng As Range) As Boolean
If Round(Rng.Value * 10) = Rng.Value * 10 Then
EstValide = True
End If
End Function
But the solver does not recognize the boolean value of the concerned cell with the relation :=2
solveradd cellref:=Range("B24"), relation:=2, formulatext:=Range("B23") 'test
solveradd cellref:=Range("B25"), relation:=2, formulatext:=Range("B23") 'test
Cells B24 B25 are found with the function and in the cell B23 i have just put "TRUE" because i want my constraint to work when TRUE.
Any Ideas on how i can solve this issue ?
In advance thank you.