SilverBack
12-03-2005, 10:28 PM
I'll make this one quick.
I have two problems:
First, I have a list of variables that take their numerical assignments from a Userform textbox. These numbers may be both positive or negative. For this to happen, how would I go about getting a number in the form of a string into a variable expecting a number? I'm thinking of Int, Fix, and CStr, but Int and Fix seem a little iffy if I have to discern between positive and negative. Is an If statement required to differentiate between using Int and Fix?
Secondly, with the same list of variables, I need to assign the textbox value to a corresponding variable only if there is something in the box. The idea is to prevent the user from having to enter all values when only one equation needs to be solved. I'm wondering if each variable will require its own If...Endif statement, or if there's a shorter way to do it.
I'm new to calling sub-routines so I've got a few bumps to hit. I've attached the code, and to make it a little easier to understand, I've placed comments throughout. If anyone can tell me what I've done that doesn't need to be done, or what I need to do, I'd greatly appreciate it. It sure seems like I'm passing a lot of variables!
Thanks!
I have two problems:
First, I have a list of variables that take their numerical assignments from a Userform textbox. These numbers may be both positive or negative. For this to happen, how would I go about getting a number in the form of a string into a variable expecting a number? I'm thinking of Int, Fix, and CStr, but Int and Fix seem a little iffy if I have to discern between positive and negative. Is an If statement required to differentiate between using Int and Fix?
Secondly, with the same list of variables, I need to assign the textbox value to a corresponding variable only if there is something in the box. The idea is to prevent the user from having to enter all values when only one equation needs to be solved. I'm wondering if each variable will require its own If...Endif statement, or if there's a shorter way to do it.
I'm new to calling sub-routines so I've got a few bumps to hit. I've attached the code, and to make it a little easier to understand, I've placed comments throughout. If anyone can tell me what I've done that doesn't need to be done, or what I need to do, I'd greatly appreciate it. It sure seems like I'm passing a lot of variables!
Thanks!