userform combobox not showing percentage in pulldown

DB73

Board Regular
Joined
Jun 7, 2022
Messages
102
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2010
  6. 2007
Platform
  1. Windows
  2. Mobile
  3. Web
Hey guys,

i'm stuck and cant find the correct answer for me.

i made an excel userform with comboboxes.
the particular, cbx5, does not what i want😵‍💫

i use this to populate my cbx
VBA Code:
ComboBox5.List = Application.Range("uur_tarief_percentage").value
its from a 1 column table
the values here are in percentage (condition format)

when i open my userform and klick the cbx, it shows not the values from the table as like "100%", it shows "1"
only after i select the "1" it populate the box with "100%

i know that actualy "100%" is "1", but i want it also shown in the pull down.
but i use this;
VBA Code:
    Private Sub ComboBox5_Change()
    ComboBox5.Text = Format(ComboBox5.Text, "0,0%")
    End Sub

the next problem is that as i say ok write to sheet with the following code
VBA Code:
'uur tarief percentage
    Sheets("dump stats").Range("S" & Rows.Count).End(xlUp).Offset(0, 0).value = ComboBox5.Text
it gonna be "1000%"😵😵‍💫
that causes a problem with calculation in other cells

i also tried to leave the conditional format just standard and use "100" but than i have to use this code;
VBA Code:
=[@[Normaal tarief]]/100*[@[uurtarief percentage]]
instead of this;
VBA Code:
=[@[Normaal tarief]]*[@[uurtarief percentage]]

cmb5 = uurtarief percentage.

all i want is that everyting is shown in "%"
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi,
Try using the Range.Text property to load your control with the formatted text of each cell in the Range & see if this resolves your issue.

VBA Code:
        Dim cell As Range
        For Each cell In Application.Range("uur_tarief_percentage").Cells
          ComboBox5.AddItem cell.Text
        Next cell

Dave
 
Upvote 1
Solution
Hi,
Try using the Range.Text property to load your control with the formatted text of each cell in the Range & see if this resolves your issue.

VBA Code:
        Dim cell As Range
        For Each cell In Application.Range("uur_tarief_percentage").Cells
          ComboBox5.AddItem cell.Text
        Next cell

Dave
this is what i needed...thanks(y)
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top