Hi Cosmos75,

Yes, you can do all of this. I take it that you want to be able to edit any one of the variables and have all the others automatically calculate to satisfy the equation. Of course, this cannot be done with cell formulae because the instant you enter a value in a cell with a formula it will wipe out the formula. It has to be done via worksheet events, namely the Change event. With the Change event you can determine (using the Target argument) which of the variables (cells) has been edited, and recalculate the others. Of course, you must have the algorithm to do this, and I assume you do. The mathematical problem here is that it appears there will be many solutions to the equation, not just one, especially if the variables do not have to be integers. But again, I assume you have all that worked out.

The one part that is questionable is limiting the range of the variables. What if there is no solution unless the solution for one of the variables goes outside its range? What would you want the program to do in this case? The easiest thing would be just to show a message saying there is no solution within the variable range, and set the entry cell back to its original value.

Regarding using the spinners to change the values, this is quite easy, especially if the variables are integer values. Just assign the spinner value (which is an integer that goes from the spinner's Min property value to its Max property value) to the variable, textbox, cell, or wherever you want to put it. If the variable is not an integer you will have to decide on a fixed step size by which the variable will change with each step of the spinner since it always steps by one. So, for example, if you want it to step by 0.25 you would multiply the spinner's Value property by 0.25 before assigning it to the variable, textbox, or cell that corresponds with that variable.

I hope this is helpful.

## Like this thread? Share it with others