Multi Line on Combo Box

jon_poole

New Member
Joined
Sep 21, 2005
Messages
8
Hi folks,

I'm using a combo box in a userform to allow user selection of text strings. Unfortunately some of the text strings are very long and keeping them on one line looks remarkably daft.

Searching through previous posts on this (frankly quite brillaint) board threw up the mutliline property for text boxes, but I can't find an equivalent for combo boxes, is this something that can be coded or am I trying the impossible?

any help/advice would be much appreciated!

many thanks.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi jon_poole,

I don't believe that a combobox or listbox control can wrap lines--the reason probably being that each line would appear to be a separate selectable item.

What I suggest you do is use a textbox with wrapping to display the currently selected item in the combobox. That way you can display the items in the combobox with a narrow width, but when the item is selected you can see the entire text. Use code such as the following:

Private Sub ComboBox1_Change()
TextBox1.Text = ComboBox1.Value
End Sub

And you will need to set both the MultiLine and WordWrap properties of the textbox to TRUE.
 
Upvote 0
Yes! that's great.

I was edging towards giving up on the userform and just validating it straight to a sheet (which would have been much less pretty and much more of a pig to deal with amending the data).

cheers for the advice!

Jon
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,457
Members
449,083
Latest member
Ava19

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