rajeshjm Posted April 24, 2009 Posted April 24, 2009 In my VBA code based on user input it has to execute the statement I need a code for this statement i created two text box. one for input and other for output If the input value is between 1 to 10 (it means the value may be 1 or 2 or 3 or 4 etc.....) then it need to show "A" in output similarly If the input value is between 11 to 20 then it need to show "B" in output Quote
CmdrDuh Posted April 24, 2009 Posted April 24, 2009 the simple way to do this is to restrict the textbox keypress to 0-9 only, then after pressed, read the value. THe problem you are going to have is if the user intends to press 12, when the 1 is pressed, textbox2 will display A, then when the 2 is pressed, it will change to B. What do you have so far? Quote
bsamc2000 Posted April 27, 2009 Posted April 27, 2009 I have wrote a couple of programs that do this in VB .Net using "Regular Expressions". Do a quick Google search to see how to use them. You should be able to test for a wide variety of conditions. I use this alot to convert between units of measure. Quote
BIGAL Posted April 29, 2009 Posted April 29, 2009 Couldn't you use a if ? If > 0.5 and If > 10.6 and If lots of numbers use case, if only two 10.5 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.