ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   convert to a number (https://www.excelbanter.com/excel-programming/342621-convert-number.html)

Paulc

convert to a number
 
Im using XL 2000

I have a userform which is taking a numerical value from a user in a textbox
named 'Value' and placing it in Worksheets("Names").Cells(newrow, "E") = Value

The value is placed as 'text' and i have to go in and manually convert to a
number.
I would like to automate this programtaically.

Any ideas?

than you
paul.

Bob Phillips[_6_]

convert to a number
 
Cast it.

Worksheets("Names").Cells(newrow, "E").Value = CDbl(Textbox1.Text)

or

Worksheets("Names").Cells(newrow, "E").Value = CLng(Textbox1.Text)


--
HTH

Bob Phillips

"Paulc" wrote in message
...
Im using XL 2000

I have a userform which is taking a numerical value from a user in a

textbox
named 'Value' and placing it in Worksheets("Names").Cells(newrow, "E") =

Value

The value is placed as 'text' and i have to go in and manually convert to

a
number.
I would like to automate this programtaically.

Any ideas?

than you
paul.




Mike Fogleman

convert to a number
 
Worksheets("Names").Cells(newrow, "E").NumberFormat = "0.00"
Put the format you want between the quotes.

Mike F

"Paulc" wrote in message
...
Im using XL 2000

I have a userform which is taking a numerical value from a user in a
textbox
named 'Value' and placing it in Worksheets("Names").Cells(newrow, "E") =
Value

The value is placed as 'text' and i have to go in and manually convert to
a
number.
I would like to automate this programtaically.

Any ideas?

than you
paul.





All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com