Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my registration form I've a textbox for writing the quantity.
The corresponding controlsource cell in the spreadsheet where my figures are collected, is set to "General Number" format. The reason is that the quantity sometimes can be without or with 1, 2 or 3 decimals. I save my registration lines to a small Excel database and have the possibility to retrieve my registred line again at a later time. If I copy a line containing a value with decimals and in general format, to the spreadsheet and then load the form, Excel will hang! If it's an integer or I set the cell to number format with fixed decimals, it works fine. Can this be solved? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You may try setting the format as 'Text'.
"Mats Samson" wrote: In my registration form I've a textbox for writing the quantity. The corresponding controlsource cell in the spreadsheet where my figures are collected, is set to "General Number" format. The reason is that the quantity sometimes can be without or with 1, 2 or 3 decimals. I save my registration lines to a small Excel database and have the possibility to retrieve my registred line again at a later time. If I copy a line containing a value with decimals and in general format, to the spreadsheet and then load the form, Excel will hang! If it's an integer or I set the cell to number format with fixed decimals, it works fine. Can this be solved? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried it and it will work, but not properly, I believe!
I didn't test it fully through but it seems I still will end up in problems. If the value is treated as pure text it cannot be used as a part of the calculation, Quantity x Price = Salesvalue. Furthermore there is the problem with localisation, as I'm Swedish, my computer is localised to Swedish numerics, using comma as decimal delimiter, not period. Excel doesn't work well in a mixed situation as Forms textboxes defaults to period delimiter and not knowing when it has to convert a number or not, it will be a big mess. I can't use text for numerics in my calculation program, that would be asking for more trouble. In fact I discovered the problem to be even more complex and posted a new message about it tonight. I believe there is a fault in either WindowsXP or Office2003/Excel behaviour when localisation is involved together with Textboxes. "JNW" wrote: You may try setting the format as 'Text'. "Mats Samson" wrote: In my registration form I've a textbox for writing the quantity. The corresponding controlsource cell in the spreadsheet where my figures are collected, is set to "General Number" format. The reason is that the quantity sometimes can be without or with 1, 2 or 3 decimals. I save my registration lines to a small Excel database and have the possibility to retrieve my registred line again at a later time. If I copy a line containing a value with decimals and in general format, to the spreadsheet and then load the form, Excel will hang! If it's an integer or I set the cell to number format with fixed decimals, it works fine. Can this be solved? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So maybe format the worksheet to accept 10 decimals (I know that's a lot, but
hold on). Then in the afterupdate event for the text box put something to count the number of non-zeros after the decimal point and adjust the number format accordingly. It seems a select case statement would work best. I just don't know how to count non-zeros after a decimal point. "Mats Samson" wrote: I tried it and it will work, but not properly, I believe! I didn't test it fully through but it seems I still will end up in problems. If the value is treated as pure text it cannot be used as a part of the calculation, Quantity x Price = Salesvalue. Furthermore there is the problem with localisation, as I'm Swedish, my computer is localised to Swedish numerics, using comma as decimal delimiter, not period. Excel doesn't work well in a mixed situation as Forms textboxes defaults to period delimiter and not knowing when it has to convert a number or not, it will be a big mess. I can't use text for numerics in my calculation program, that would be asking for more trouble. In fact I discovered the problem to be even more complex and posted a new message about it tonight. I believe there is a fault in either WindowsXP or Office2003/Excel behaviour when localisation is involved together with Textboxes. "JNW" wrote: You may try setting the format as 'Text'. "Mats Samson" wrote: In my registration form I've a textbox for writing the quantity. The corresponding controlsource cell in the spreadsheet where my figures are collected, is set to "General Number" format. The reason is that the quantity sometimes can be without or with 1, 2 or 3 decimals. I save my registration lines to a small Excel database and have the possibility to retrieve my registred line again at a later time. If I copy a line containing a value with decimals and in general format, to the spreadsheet and then load the form, Excel will hang! If it's an integer or I set the cell to number format with fixed decimals, it works fine. Can this be solved? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula problem with decimal | Excel Worksheet Functions | |||
Problem with decimal format | Excel Worksheet Functions | |||
problem with decimal in calculation | Excel Discussion (Misc queries) | |||
Decimal translation problem | Excel Discussion (Misc queries) | |||
Problem with decimal number smaller than 1 | Excel Programming |