Forum Discussion

dxq92's avatar
dxq92
Copper Contributor
Jun 12, 2022

[Excel Solver issue] There is a different when run the macro whit or whitout a button

I  Add a sub and run it in Vbe or View->Macros->Run

 

 

 

 

 

Sub test1()
    SolverReset
    SolverAdd CellRef:="$a$1", Relation:=1, FormulaText:="1"
End Sub

 

 

 

 

 

 

The result is what i need

 

But when i add a button to run the macro,There is nothing .

 

after that i modify 1 to 0.99 and run it again.

 

 

 

 

 

Sub test1()
    SolverReset
    SolverAdd CellRef:="$a$1", Relation:=1, FormulaText:="0.9999"
End Sub

 

 

 

 

 

 

Resources