ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   "combo box- numeric characters" (https://www.excelbanter.com/excel-discussion-misc-queries/13234-%22combo-box-numeric-characters%22.html)

adam.ronalds

"combo box- numeric characters"
 
How do you get the final displayed number in a control combo box to have the
same format as the list fill range numbers?

Dave Peterson

Maybe a bit of code.

Go into design mode (an icon on that control toolbox toolbar) and then double
click on that combobox.

Paste this into that window:

Option Explicit
Dim BlkProc As Boolean
Private Sub ComboBox1_Change()
If BlkProc = True Then Exit Sub
With Me.ComboBox1
BlkProc = True
.Value = Format(.Value, "##0.00000")
BlkProc = False
End With
End Sub

(Change the format to what you want to see.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

adam.ronalds wrote:

How do you get the final displayed number in a control combo box to have the
same format as the list fill range numbers?


--

Dave Peterson


All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com