ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform scrollbar nightmare! (https://www.excelbanter.com/excel-programming/409276-userform-scrollbar-nightmare.html)

anon

Userform scrollbar nightmare!
 
Hi all,

Having battled the comboboxes i'm now stuck with my scroll bars on my
user form.

I've created a large user form with about 180 controls. It's approx
2500 high so i need a vertical scroll bar. When i set scrollbars to
visible in the properties of the user form the vertical scroll bar
shows but has no bar to scroll up or down with.

I've also tried statements like the below in the initialise event
code;

July08.ScrollBars = fmScrollBarsVertical
July08.Scroll fmScrollActionBegin
July08.ScrollBars = 2
July08.ScrollHeight = 350

But no avail. I've searched and not found any other solutions on here
so I'd love some help. Thanks.

JLGWhiz

Userform scrollbar nightmare!
 
I'm guessing, but try this:

July08.ScrollBart1.ScrollHeight = 350



"anon" wrote:

Hi all,

Having battled the comboboxes i'm now stuck with my scroll bars on my
user form.

I've created a large user form with about 180 controls. It's approx
2500 high so i need a vertical scroll bar. When i set scrollbars to
visible in the properties of the user form the vertical scroll bar
shows but has no bar to scroll up or down with.

I've also tried statements like the below in the initialise event
code;

July08.ScrollBars = fmScrollBarsVertical
July08.Scroll fmScrollActionBegin
July08.ScrollBars = 2
July08.ScrollHeight = 350

But no avail. I've searched and not found any other solutions on here
so I'd love some help. Thanks.


JLGWhiz

Userform scrollbar nightmare!
 
Without the typo:

July08.ScrollBar1.ScrollHeight = 350



"JLGWhiz" wrote:

I'm guessing, but try this:

July08.ScrollBart1.ScrollHeight = 350



"anon" wrote:

Hi all,

Having battled the comboboxes i'm now stuck with my scroll bars on my
user form.

I've created a large user form with about 180 controls. It's approx
2500 high so i need a vertical scroll bar. When i set scrollbars to
visible in the properties of the user form the vertical scroll bar
shows but has no bar to scroll up or down with.

I've also tried statements like the below in the initialise event
code;

July08.ScrollBars = fmScrollBarsVertical
July08.Scroll fmScrollActionBegin
July08.ScrollBars = 2
July08.ScrollHeight = 350

But no avail. I've searched and not found any other solutions on here
so I'd love some help. Thanks.


anon

Userform scrollbar nightmare!
 

I get the error 'method or data member not found' on the line you
suggested. I presume because I haven't created a scroll bar 1 - i'm
not sure how to do this via code.

anon

Userform scrollbar nightmare!
 
OK i've figured;

With Me
Label1.Move ((.InsideWidth - Label1.Width) / 2),
((.InsideHeight - Label1.Height) / 2)
.ScrollBars = fmScrollBarsBoth
.ScrollHeight = 3000
.ScrollWidth = 1200
.ScrollTop = 0
End With

However my problem is now that the form doesn't fit to the page, but
disappears off the bottom of the page - any suggestions (i thought
making it modal would work but no luck)

JLGWhiz

Userform scrollbar nightmare!
 
The Height is measured in pixels. If you reduce the height from 3000 to 500
it might work better. You could also look at the Max/Min properties to see
if they could be applied in this case.

"anon" wrote:

OK i've figured;

With Me
Label1.Move ((.InsideWidth - Label1.Width) / 2),
((.InsideHeight - Label1.Height) / 2)
.ScrollBars = fmScrollBarsBoth
.ScrollHeight = 3000
.ScrollWidth = 1200
.ScrollTop = 0
End With

However my problem is now that the form doesn't fit to the page, but
disappears off the bottom of the page - any suggestions (i thought
making it modal would work but no luck)



All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com