Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to convert text input to a number
Hi all, What is the code to convert text taken from a input text box (on form) into a number that can be used for manipulation? Thank -- FC ----------------------------------------------------------------------- FCC's Profile: http://www.excelforum.com/member.php...fo&userid=3588 View this thread: http://www.excelforum.com/showthread.php?threadid=56890 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to convert text input to a number
Hi FCC,
Try: Dim myValue As Double myValue = CDbl(TextBox1.Value) --- Regards, Norman "FCC" wrote in message ... Hi all, What is the code to convert text taken from a input text box (on a form) into a number that can be used for manipulation? Thanks -- FCC ------------------------------------------------------------------------ FCC's Profile: http://www.excelforum.com/member.php...o&userid=35888 View this thread: http://www.excelforum.com/showthread...hreadid=568900 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to convert text input to a number
If you use the Application.InputBox instead of VBA.InputBox, you can specify
a Type:=1 argument, to limit the user to numbers. e.g. Debug.Print VarType(Application.InputBox("Some prompt", , , , , , , 1)) 5 shows that a double was returned. You still need to check for the Cancel, which =False. NickHK "FCC" wrote in message ... Hi all, What is the code to convert text taken from a input text box (on a form) into a number that can be used for manipulation? Thanks -- FCC ------------------------------------------------------------------------ FCC's Profile: http://www.excelforum.com/member.php...o&userid=35888 View this thread: http://www.excelforum.com/showthread...hreadid=568900 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code to convert text input to a number
Ignore this as I misread your "input text box" for an input box.
NickHK "NickHK" wrote in message ... If you use the Application.InputBox instead of VBA.InputBox, you can specify a Type:=1 argument, to limit the user to numbers. e.g. Debug.Print VarType(Application.InputBox("Some prompt", , , , , , , 1)) 5 shows that a double was returned. You still need to check for the Cancel, which =False. NickHK "FCC" wrote in message ... Hi all, What is the code to convert text taken from a input text box (on a form) into a number that can be used for manipulation? Thanks -- FCC ------------------------------------------------------------------------ FCC's Profile: http://www.excelforum.com/member.php...o&userid=35888 View this thread: http://www.excelforum.com/showthread...hreadid=568900 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert text string to a number code | Excel Discussion (Misc queries) | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
Convert text strings to a code or number | Excel Worksheet Functions | |||
Pause code, wait for input, no input received, carry on with the code | Excel Programming | |||
convert text-format number to number in excel 2000%3f | Excel Discussion (Misc queries) |