Yes but after this it will be String, String is using for text, I need
Double or Single.
Tomas
> Hi Tom
>
[quoted text clipped - 5 lines]
> Excel Templates, Training, Add-ins & Business Software Galore!
> Free Excel Forum http://www.ozgrid.com/forum ***
Dave Hawley - 29 Apr 2004 10:51 GMT
No it wont. Not if the Textbox has a number and you use .Value
Unless you have dimmensioned MyNewVar as a String
Tom - 29 Apr 2004 10:59 GMT
I tried this:
rem this is part which start after click on OK button in my Form
MyVar = TextBox.Value
MsgBox TypeName(MyVar)
and its String
> No it wont. Not if the Textbox has a number and you use .Value
>
[quoted text clipped - 3 lines]
> Excel Templates, Training, Add-ins & Business Software Galore!
> Free Excel Forum http://www.ozgrid.com/forum ***
Tom - 29 Apr 2004 10:51 GMT
This is big problem. for example when I want do tihs in Forms:
TextBox1 = 23
TextBox2 = 100
If TextBox1 > TextBox2 Then
MsgBox "YES"
End If
Program said YES. And same problem I hve in another parts in my program.
> Yes but after this it will be String, String is using for text, I need
> Double or Single.
[quoted text clipped - 10 lines]
> > Excel Templates, Training, Add-ins & Business Software Galore!
> > Free Excel Forum http://www.ozgrid.com/forum ***
Dave Hawley - 29 Apr 2004 10:57 GMT
Tom. The default for a TextBox is Text. Simply use;
TextBox1.Value
NOT
Textbox1
or
Textbox1.Text
Tom - 29 Apr 2004 11:09 GMT
I found this....I was supid
I used Double but I have to use Currency so:
MyNewVar = CCur(Text.Box)
its enough for me, now everything works like I need
Thanks
> Tom. The default for a TextBox is Text. Simply use;
>
[quoted text clipped - 9 lines]
> Excel Templates, Training, Add-ins & Business Software Galore!
> Free Excel Forum http://www.ozgrid.com/forum ***
dave - 29 Apr 2004 11:20 GMT
Dim myVar As Double
Will fix that. I cannot see any point in passing a Text number to a
variant, then converting it after. It's double handling.
Tom - 29 Apr 2004 12:19 GMT
I use it becase I give some data to TextBox for look in my Form and then I
take this data and put them to Worksheet.
> Dim myVar As Double
>
[quoted text clipped - 4 lines]
> Excel Templates, Training, Add-ins & Business Software Galore!
> Free Excel Forum http://www.ozgrid.com/forum ***
Tom - 29 Apr 2004 12:42 GMT
No, it worked now is same problem...Type mismatch
Someone make game of me.
> I found this....I was supid
>
[quoted text clipped - 19 lines]
> > Excel Templates, Training, Add-ins & Business Software Galore!
> > Free Excel Forum http://www.ozgrid.com/forum ***