Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Trailing Zeros
I'm designing a combobox with decimal numbers. When I use .additem and type
in the numbers, it drops the trailing zeros. (ie. 0.500 becomes 0.5 automatically) I need the zeros for precision and consistancy purposes. Is there a line I can include in this code? With ComboBox1 .ListRows = 20 .AddItem (0.375) .AddItem (0.5) .AddItem (0.75) End With |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Trailing Zeros
Since they're text in the combobox, just add them as text:
With ComboBox1 .ListRows = 20 .AddItem "0.375" .AddItem "0.500" 'or even .AddItem format(0.75,"0.000") End With aftamath77 wrote: I'm designing a combobox with decimal numbers. When I use .additem and type in the numbers, it drops the trailing zeros. (ie. 0.500 becomes 0.5 automatically) I need the zeros for precision and consistancy purposes. Is there a line I can include in this code? With ComboBox1 .ListRows = 20 .AddItem (0.375) .AddItem (0.5) .AddItem (0.75) End With -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Trailing Zeros
..AddItem format(0.375, "0.000")
-- HTH... Jim Thomlinson "aftamath77" wrote: I'm designing a combobox with decimal numbers. When I use .additem and type in the numbers, it drops the trailing zeros. (ie. 0.500 becomes 0.5 automatically) I need the zeros for precision and consistancy purposes. Is there a line I can include in this code? With ComboBox1 .ListRows = 20 .AddItem (0.375) .AddItem (0.5) .AddItem (0.75) End With |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Trailing Zeros
Thanks Dave. "The simplest answers..."
"Dave Peterson" wrote: Since they're text in the combobox, just add them as text: With ComboBox1 .ListRows = 20 .AddItem "0.375" .AddItem "0.500" 'or even .AddItem format(0.75,"0.000") End With aftamath77 wrote: I'm designing a combobox with decimal numbers. When I use .additem and type in the numbers, it drops the trailing zeros. (ie. 0.500 becomes 0.5 automatically) I need the zeros for precision and consistancy purposes. Is there a line I can include in this code? With ComboBox1 .ListRows = 20 .AddItem (0.375) .AddItem (0.5) .AddItem (0.75) End With -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I force trailing zeros in an Excel cell? | New Users to Excel | |||
forcing trailing zeros on 5-digit Zip | Excel Discussion (Misc queries) | |||
Keep numbers as entered with trailing zeros | Excel Discussion (Misc queries) | |||
Keep Trailing Zeros When Convert To Text | Excel Discussion (Misc queries) | |||
Formula/formatting to omit trailing zeros | Excel Worksheet Functions |