Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Scroll Bars in UserForms

I've a userform that sometimes extends beyond the edge of the screen, so
i'd like to put a vertical scroll bar in to view the whole thing.

I've tried google, but the closest i got was a page in german, which i
don't speak.

Can anyone explain or direct me to a webpage that can tell me how to
put a scroll bar into a large userform to scroll to the bottom and top.


I'm not sure if it matters, but the userforms size is variable based on
the number of rows matching particular criteria. I can't imagine it
will, but just thought i would mention it just in case it effects it.

Thanks

James


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Scroll Bars in UserForms

Hi James

Put a Frame1 on a new userform. Put a Frame2 inside Frame1. Put whatever
onto Frame2 just to watch. Insert a vertical Scrollbar1. Try this code:

Private Sub UserForm_Initialize()
Frame2.Height = Frame1.Height * 2
ScrollBar1.Max = Frame1.Height
ScrollBar1.LargeChange = ScrollBar1.Max / 4
ScrollBar1.SmallChange = 8
End Sub

Private Sub ScrollBar1_Change()
Frame2.Top = -ScrollBar1.Value
End Sub

Private Sub ScrollBar1_Scroll()
Frame2.Top = -ScrollBar1.Value
End Sub



--
HTH. Best wishes Harald
Followup to newsgroup only please

"Jmbostock " skrev i melding
...
I've a userform that sometimes extends beyond the edge of the screen, so
i'd like to put a vertical scroll bar in to view the whole thing.

I've tried google, but the closest i got was a page in german, which i
don't speak.

Can anyone explain or direct me to a webpage that can tell me how to
put a scroll bar into a large userform to scroll to the bottom and top.


I'm not sure if it matters, but the userforms size is variable based on
the number of rows matching particular criteria. I can't imagine it
will, but just thought i would mention it just in case it effects it.

Thanks

James


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Scroll Bars in UserForms

Userform
ScrollBars

Look at the properties of your userform. See what the height of the form
is. Assume it is 300

Now look at the scroll height property and set it to match ( 300 for the
example)

Now go back to the height property and make it something small. Start with
half the height (150 for the example)


Set the scrollbars property to frmScrollBarsVertical

now show your form.

You should be able to scroll your form.

--
Regards,
Tom Ogilvy

"Jmbostock " wrote in message
...
I've a userform that sometimes extends beyond the edge of the screen, so
i'd like to put a vertical scroll bar in to view the whole thing.

I've tried google, but the closest i got was a page in german, which i
don't speak.

Can anyone explain or direct me to a webpage that can tell me how to
put a scroll bar into a large userform to scroll to the bottom and top.


I'm not sure if it matters, but the userforms size is variable based on
the number of rows matching particular criteria. I can't imagine it
will, but just thought i would mention it just in case it effects it.

Thanks

James


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
scroll bars Cutearmychic Excel Worksheet Functions 1 August 22nd 08 08:53 PM
SCROLL BARS GSB Excel Discussion (Misc queries) 1 September 28th 07 05:03 PM
Scroll bars Tazzy via OfficeKB.com Excel Discussion (Misc queries) 3 December 10th 06 10:28 PM
Scroll bars Embalmer Excel Discussion (Misc queries) 1 December 31st 05 05:05 PM
What is a clean way of controlling Scroll bars when using filters with Userforms? Bruccce Excel Programming 4 September 2nd 03 10:31 PM


All times are GMT +1. The time now is 12:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"