View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default 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