I have a problem with combobox for showing content.
When I scroll some of the content, like in the attached picture, it is hidden.
My combobox
text alignment is to the right
Taken from this source you can put this code in your UserForm.Initialize
procedure, e.g.:
Private Sub UserForm_Initialize()
Dim I As Long, TempString As String
UserForm1.ComboBox1.ColumnCount = 2
TempString = LTrim$(Str$(UserForm1.ComboBox1.Width - 15))
UserForm1.ComboBox1.ColumnWidths = TempString & " pt; 15 pt"
For I = 1 To 10
UserForm1.ComboBox1.AddItem "Hello" & Str$(I)
Next I
End Sub
Another option that works for me is:
Private Sub UserForm_Initialize()
Dim I As Long
For I = 1 To 10
UserForm1.ComboBox1.AddItem "Hello " & I & " "
Next I
End Sub
This last option would just put enough trailing spaces to let the text appear fully. Note that when you use those values you will have to TRIM
them down.
Tags: excelexcel, scroll