No scroll bars wanted

GeorgeB

Board Regular
Joined
Feb 16, 2002
Messages
239
On a UserForm I have a ListBox and I want to delete both scroll bars. The side one only shows when necessary but the botom one shows until the width of the listbox equals or exceed 75. From the help files I have tried the following:

ListBox1.KeepScrollBarsVisible = fmScrollBarsNone
UserForm1.ListBox1.KeepScrollBarsVisible = fmScrollBarsNone
UserForm1.ListBox1.ScrollBars = fmScrollBarsNone
ListBox1.ScrollBars = fmScrollBarsNone
ListBox1.ScrollBars = False
ListBox1.ScrollBars = 0

How do I get rid of the bottom scrollbar?

Edit: These were put in the UserForm Initialize section.





_________________
George

Learn to listen. Opportunity sometimes knocks very softly.
This message was edited by GeorgeB on 2002-08-31 11:59
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
I think you might have to just make sure the listbox is wide enough to take the entries. I don't think the KeepScrollBarsVisible and ScrollBars properties don't actually apply to a listbox anyway.
 

stevebausch

Well-known Member
Joined
May 11, 2002
Messages
810
How many columns?
How wide are the ColumnWidths?

If you do alter ColumnWidths (programmatically), do it before any other ListBox details.

I have some code with this comment:
'make your assignments AFTER .ColumnWidths, else you lose the selection

I can't recall the situation, and it's MY code :eek:
This message was edited by stevebausch on 2002-08-31 12:59
 

GeorgeB

Board Regular
Joined
Feb 16, 2002
Messages
239
Thanks for responding
The ListBox width is 30 and only contains three character abbreviations. I really don't want to make it wider. The help files
say that the scrollbars for listboxes can be
controlled with these commands.
 

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339

ADVERTISEMENT

Really? I just checked the help files and the two properties only apply to Frames, MultiPages, TextBoxes (ScrollBars only) and the UserForm itself. I'm using Excel 2000 and the autocomplete doesn't give me an entry for either after typing ListBox1.

After a bit of messing, a three letter entry can be contained within a listbox with a width of 33 points without scrollbars appearing.
 

GeorgeB

Board Regular
Joined
Feb 16, 2002
Messages
239
Hi Mudface
Tell me how you did this. I'm using Excel 2000 also and my ListBox is populated using the additem method with a max of three uppercase letters CHG being the largest.
Still even after increasing the width to 34 I still have a bottom scrollbar. I can't
make it wider without disrupting the whole form.
Edit: Your right it doesn't apply to a listbox. I misread something in the help file. I made room to expand the box more
but still the bottom scrollbar stays until
it exceeds 75 width.
_________________
George

Learn to listen. Opportunity sometimes knocks very softly.
This message was edited by GeorgeB on 2002-08-31 17:31
 

stevebausch

Well-known Member
Joined
May 11, 2002
Messages
810

ADVERTISEMENT

It's the .ColumnWidths ..St.. Stu..(no, mustn't say it..)

Set .ColumnWidths to a value smaller than .Width


I have .ColumnWidths set to 15 pt, .Width set to 20, and no scrollbar.
 

GeorgeB

Board Regular
Joined
Feb 16, 2002
Messages
239
Thank you Steve for that clarification. I didn't understand your previous post.
That does the trick. Have a nice day.
 

UHsoccer

Well-known Member
Joined
Apr 3, 2002
Messages
1,023
Reply to SteveBausch

That is the first time I read about the relationship and the effect of Width and Column-Width

I also wanted to reduce the width of a listbox and never show scrollbars. Since he scroll bar is not a property of a listbox, your solution is superb!!

Great forum
 

Forum statistics

Threads
1,144,510
Messages
5,724,784
Members
422,579
Latest member
Lekha mohanty

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
Top