Hello I am trying to create a calculator in excel using vba that will calculate any variable of an equation if all but one variable is given. For example if I have the equation--vehicle speed=rpm x gear ratio x tire size--I would like to be able to imput any combination of three variables and have the fourth one calculated. I have attached a spreadsheet of what I have so far. Currently on sheet one I have a working calculater although it is not very stream lined. For it to work correctly you have to imput your known values and then clear the contents of the the variable that you are wanting to calculate for. I would prefer that i just enter the values and not have to clear the cells, or possibly leave the desired variable to calculate blank, and then tell the macro to run.
The logic for this task, I believe, would need to determine what cell is blank or imputted as zero and then based on this test it would then pick out which of the possible formulas (four in the case above) should be used to calculate the desired missing value.
The attached spreadsheet also hase an inch to millimeter converter on sheet two. The code on sheet two for this converter works perfect and I tried to modify it to do the task of sheet one but adding multiple imputs seems to cause problems
I am also open to suggestions if my current method for sheet one is not the most optimal.
converter.xlsm
Bookmarks