How to create ComboBox with 3 decimal places, Please Help!

  • Thread starter Thread starter pmind
  • Start date Start date
P

pmind

I've created a ComboBox on a UserForm and would like it to display a 3
place decimal (3 significant places), how/where do add code to do this?
I'm just pulling the values from my worksheet for the user to select an
optional size.
I think (hope) this might be the solution to the "rolling Combobox"
problem I'm having; see this post:
http://groups.google.com/group/micr...0e5963fa968/2ec1669166f74ac5#2ec1669166f74ac5

I sure would appreciate some advice!
(...my boss is getting a little impatient by now!)

Thanks, Paul
 
Hello
If you are pulling your values from a worksheet, you may consider this:
With Worksheets("Sheet1")
For i = 1 To .Range("A65536").End(xlUp).Row
Me.ComboBox1.AddItem (Format(.Cells(i, 1), "0.000"))
Next i
End With

HTH
Cordially
Pascal
 
Thanks Pascal,
Since I'm not really a VBA wizard (...nor do I play one on TV), could
you please tell me exactly where I might insert this code?

Paul
 
Paul
You may also consider amending the sample code I supplied with
1- the relevant sheet name
2- and the range where your data stands
(in my sample code sheet name is Sheet1 and Data starts from range A1
downwards)


HTH
Cordially
Pascal
 
Can't see my previous post?
So here it is again:
Hello Paul
You may put the code in the Userform_Initialize event

HTH

Cordially
Pascal
 
Thanks Pascal,
I'm putting out another fire at the moment, I should try out the code
early this afternoon. I'll keep you posted.

Paul
 
Yep, that did the trick for the decimal places. Thanks.
Now, do you have ANY idea why my ComboBox won't
retain my selection (this is from the post that I refer to above)?

Paul
 
Pascal,
I fixed the problem that I was having with the ComboBox "rolling" as
described in post linked above.

Thanks for your help. Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top