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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
Thank you Steve for that clarification. I didn't understand your previous post.
That does the trick. Have a nice day.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,530
Members
448,969
Latest member
mirek8991

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