Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Strange behavior with text box values . . . help!
I have a strange problem with code that I am running with numerics that I am
puting into text boxes. I have made a user form that asks my unit supervisors to input two numbers into two different text boxs. The first box is the number of times that a task is required. The second box is the number of times that the task was actually performed. The code that I attached to the "times done" box checks to see if the user accidentally switched the values and then offers to switch them back. And all works fine until . . . If the user puts in the values of 10 and 9, then the code pops up the message box saying that the times done is greater than the times required, even though they are not. If I input 10 and 09, then the code works as intended. I am hoping there is a simple solution to this that I have not seen yet. Will |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Strange behavior with text box values . . . help!
values in a textbox are strings. therefore you get the seemingly wrong
answer. if clng(textbox2.Value) clng(textbox1.Value) then Using clng to convert the text numbers to actual numbers should clear up the problem. -- Regards, Tom Ogilvy "WillRn" wrote in message ... I have a strange problem with code that I am running with numerics that I am puting into text boxes. I have made a user form that asks my unit supervisors to input two numbers into two different text boxs. The first box is the number of times that a task is required. The second box is the number of times that the task was actually performed. The code that I attached to the "times done" box checks to see if the user accidentally switched the values and then offers to switch them back. And all works fine until . . . If the user puts in the values of 10 and 9, then the code pops up the message box saying that the times done is greater than the times required, even though they are not. If I input 10 and 09, then the code works as intended. I am hoping there is a simple solution to this that I have not seen yet. Will |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Strange behavior | Excel Discussion (Misc queries) | |||
Strange behavior | Setting up and Configuration of Excel | |||
Strange behavior. | Excel Discussion (Misc queries) | |||
Strange behavior w/ Text, Button, & Check Boxes | Excel Discussion (Misc queries) | |||
Strange behavior Chart.SeriesCollection(n).Values property | Excel Programming |