Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox input interpretation
Hello,
in Sweden it's common to use the comma as a decimal delimiter and the period as thousand delimiter. I have the Regional and Language Options set accordingly. Textboxes though treats a number written as 1.234,56 as text as default formatting is ##,##0.00. It creates formatting problems reading numbers from cells into textboxes and vice versa. Can it be solved? Regards Mats |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox input interpretation
Thank you Steven!
It helped! "Stephen Bullen" wrote: Hi Mats, Hello, in Sweden it's common to use the comma as a decimal delimiter and the period as thousand delimiter. I have the Regional and Language Options set accordingly. Textboxes though treats a number written as 1.234,56 as text as default formatting is ##,##0.00. It creates formatting problems reading numbers from cells into textboxes and vice versa. Can it be solved? That will happen if you're trying to write the text from the text box directly to a cell. Instead, wrap it in the CDbl() function, to explicity convert it to a number, according to your regional settings: Range("A1").Value = CDbl(txtBox.Text) For much more information about this, read the "International Issues" chapter of the Excel 2002 VBA Programmer's Reference, which is available for download from my web site (http://www.oaltd.co.uk/ExcelProgRef/Default.htm). Regards Stephen Bullen Microsoft MVP - Excel Professional Excel Development The most advanced Excel VBA book available www.oaltd.co.uk/ProExcelDev |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Textbox input interpretation
Hi Mats,
Hello, in Sweden it's common to use the comma as a decimal delimiter and the period as thousand delimiter. I have the Regional and Language Options set accordingly. Textboxes though treats a number written as 1.234,56 as text as default formatting is ##,##0.00. It creates formatting problems reading numbers from cells into textboxes and vice versa. Can it be solved? That will happen if you're trying to write the text from the text box directly to a cell. Instead, wrap it in the CDbl() function, to explicity convert it to a number, according to your regional settings: Range("A1").Value = CDbl(txtBox.Text) For much more information about this, read the "International Issues" chapter of the Excel 2002 VBA Programmer's Reference, which is available for download from my web site (http://www.oaltd.co.uk/ExcelProgRef/Default.htm). Regards Stephen Bullen Microsoft MVP - Excel Professional Excel Development The most advanced Excel VBA book available www.oaltd.co.uk/ProExcelDev |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel input mask for textbox | Excel Discussion (Misc queries) | |||
validating input in textbox | Excel Programming | |||
Input mask for userform textbox | Excel Programming | |||
validation of input in textbox | Excel Programming | |||
Limit input in a textbox | Excel Programming |