How to get rid of the bottom scroll bar in a ListBox

V

Valeria

Dear Experts,
I would like to insert a ListBox in my userform that
contains several items, and that can be scrolled down with
a scroll-down bar on the right-hand side of the ListBox.
The ListBox shows though with 2 scroll bars, one at the
bottom and one on the right - how can I get rid of the one
at the bottom?
My code for populating the ListBox is:

Sub Show_Userform()
'Fill the listbox1
With UserForm1.ListBox1
.RowSource = ""
.AddItem "01"
.AddItem "02"
.AddItem "21"
.AddItem "30"
.AddItem "31"
.AddItem "38"
.AddItem "50"
.AddItem "72"
End With
UserForm1.Show 0
End Sub


Many thanks in advance.
Best regards,
Valeria
 
C

Chip Pearson

Valeria,

You typically get a scroll bar at the bottom of the list box when
VBA things that the list is not wide enough. Increase the width
of the list box.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
N

Nigel

I don't think you can remove it, but if you set the column width property to
a value greater than your data item width the scroll bar should be off.
Cheers
Nigel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top