Hi,
I'm trying to make a tool that solves a linear system of equations using the solver. I've recorded a macro to figure out how VBA fills the solver, now I simply want to loop over all constraints that I want to add using a counter. This all goes well escept when:
- The constraint is ' > 1'
- The constraint is 'output should be integers'
I've tried to step by step go over the code, and it shows in yellow that the code responsible for the above constraints is executed. But after running the macro specifically the above constraints are missing from the solver.
The loop code:
where 'Var' is the number of variables X1...Xn
And 'st' is the number of constraints
When I manually use the solver on a dummy-system, it works fine. When I use VBA to do the exact same thing, it just ignores constraint iff
Cells(10 + c, 5).Value = 1
And it just skips the integer part always
even though using F8 shows that it goes over the code
If anyone knows what's going on here, please let me know!
Bookmarks