View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default How to make Scroll Bar work on a form

I assume you want the user to be able to scroll the userform vertically:

In design mode in the VBE, the userform should be large enough hold all the
controls.

Use code like this in the Userform Initialize event:

Private Sub UserForm_Initialize()
UserForm1.ScrollBars = fmScrollBarsVertical
UserForm1.KeepScrollBarsVisible = fmScrollBarsNone

UserForm1.Height = UserForm1.Height / 2
UserForm1.ScrollHeight = 2 * UserForm1.Height
' UserForm1.ScrollWidth = 2 * UserForm1.Width


End Sub

--
Regards,
Tom Ogilvy


"clara" wrote:

Hi all,

After set Scrollbars and KeepScrollbarVisible on my form, there are scroll
arrow in two end of the bar, but no scroll handler in the middle of the bar.
Actually, there is a textbox whose lenght is already over the form length.

Clara
--
thank you so much for your help