Ladies, Gentlemen,
Further to my earlier post re "Calculating in a Userform" which was speedily resolved by Norie I thought to be smart and use the "change" event of the combo-box instead of the command-button to trigger some more calculations, as the value of the combo-box is common to both formulas.
However, while running the code I was -unpleasantly- surprised by a VBA messagebox stating "Run-time Error 13" - Type Mismatch.
An intensive search on the Net gave me a wealth of information but not what I was looking for to solve this problem.
Therefore I went into the debug mode and when my mouse hovered over the cboSchaal.Value(3.5) in t6he second calculation it showed "Type mismatch" and the code stopped running.
I am aware that cboSchaal.Value is quite different from
cboSchaal.Value(3.5), hence the error.
The formula however requires the value of the combo-box be raised to the power 3.5 in order to calculate the power required for the modelship.
The formula itself is correct (tested in a worksheet) and the answer should be 8.86 Watts (based on scale 1:24)
Therefore I think I make a mistake in the syntax of the formula, but which one ? Again searched the Net for some time, to no avail. Any suggestions will be very much appreciated as I am relatively new to VBA and learning as I go along. Have tried various variables (DIM, Static, Public and so on) but wasn't succesful. Looking forward to your suggestions, thanks in advance....
P.S. Underneath the userform and the associated code.
userform2.jpg
Best regards, Dirk Smit
Bookmarks