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
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
Hi FCC,
Try:
Dim myValue As Double
myValue = CDbl(TextBox1.Value)
---
Regards,
Norman
"FCC" <[email protected]> wrote in message
news:[email protected]...
>
> 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
>
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" <[email protected]> wrote in message
news:[email protected]...
>
> 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
>
Ignore this as I misread your "input text box" for an input box.
NickHK
"NickHK" <[email protected]> wrote in message
news:[email protected]...
> 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" <[email protected]> wrote in message
> news:[email protected]...
> >
> > 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
> >
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks