Share via

Formatting a Combo Box

Anonymous
2010-11-17T20:43:19+00:00

I have an active x combo box with a list of 10%, 20% etc.  When I click on the Combo Box it displays for 10% -**0.1.  How can i get it to show 10%, 20%, etc.**Thanking you in advance.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

7 answers

Sort by: Most helpful
  1. Anonymous
    2010-11-17T20:54:59+00:00

    Hi,

    Where is this combobox, userform?, worksheet?

    If it's a worksheet then tell us what's in the 'listfill' range

    If a userform then how are you populating the combobox?


    If this post answers your question, please mark it as the Answer.

    Mike H

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2010-11-17T20:55:57+00:00

    Youl could have something like this in the ComboBox_Change event:

    Private Sub ComboBox1_Change()

    ComboBox1.Text = Format(ComboBox1.Value, "0 %")

    End Sub

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2010-11-18T17:11:07+00:00

    This is just a worksheet.  In the Listfill range it is 10%, 20%, 30%, etc. which is in A11 - A20.  When I select the dropdown it shows 10%, 20%, 30%, etc, but actually displays 0.1, 0.2, 0.3.  I tried the suggestion from Luke too, but it is not changing.  Really struggling with this.  thanks. 

    Hi,

    So this is an Active X ComBoBox on a worksheet. In which case if you implemented it correctly then Luke's suggestion should have worked.

    To implement Luke's suggestion, put the combobox into design mode and right click it. view code and paste the code in on the right. Don't forget you will need to the bold bit to the name of your combobox.

    Private Sub ComboBox1_Change()

    ComboBox1.Text = Format(ComboBox1.Value, "0 %")

    End Sub


    If this post answers your question, please mark it as the Answer.

    Mike H

    0 comments No comments
  4. Anonymous
    2010-11-18T17:10:36+00:00

    This is just a worksheet.  In the Listfill range it is 10%, 20%, 30%, etc. which is in A11 - A20.  When I select the dropdown it shows 10%, 20%, 30%, etc, but actually displays 0.1, 0.2, 0.3.  I tried the suggestion from Luke too, but it is not changing.  Really struggling with this.  thanks. 

    You could enter the data in the Listfill range as text. Then, if you need to do math calculations with the selected item it will get coerced into the numeric equivalent.

    For example A11 = the TEXT entry 10%.

    The combo box displays the text entry 10%.

    A1 = the combo box linked cell containing the text entry 10%.

    If you need to use that in a math operation, like, find 10% of 100...

    =100*A1

    The text entry, 10%, gets coerced into the numeric equivalent 0.1. So:

    =100*A1 = 10

    --

    Biff

    Microsoft Excel MVP

    0 comments No comments
  5. Anonymous
    2010-11-18T16:50:25+00:00

    This is just a worksheet.  In the Listfill range it is 10%, 20%, 30%, etc. which is in A11 - A20.  When I select the dropdown it shows 10%, 20%, 30%, etc, but actually displays 0.1, 0.2, 0.3.  I tried the suggestion from Luke too, but it is not changing.  Really struggling with this.  thanks.

    0 comments No comments