Thread: Trailing Zeros
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default 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