#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Scroll bar

Hello! I have a user from that unfortunately has become very long. Therefore
I need a scrollbar so that the user shall be able to scroll his/her way down
to the end of the user form. I found something that looked like a scrollbar
in the tools for the user form but I do not know how to write code for it and
my help function for vba does not work. Please if you know how to write code
for this, help me out! Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Scroll bar

Why not use the built in scrollbar on the userform itself. Look at the
properties of the userform to turn on the scrollbar.

--
Regards,
Tom Ogilvy


"Viktor Ygdorff" wrote:

Hello! I have a user from that unfortunately has become very long. Therefore
I need a scrollbar so that the user shall be able to scroll his/her way down
to the end of the user form. I found something that looked like a scrollbar
in the tools for the user form but I do not know how to write code for it and
my help function for vba does not work. Please if you know how to write code
for this, help me out! Thank you!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Scroll bar

Or you could put this in your initialize event for the Userform:

Private Sub UserForm_Initialize()
UserForm1.ScrollBars = fmScrollBarsVertical
UserForm1.ScrollHeight = UserForm1.Height
UserForm1.Height = UserForm1.Height / 2
End Sub

This assumes in the VBE you can see the entire userform.

--
Regards,
Tom Ogilvy


"Viktor Ygdorff" wrote:

Hello! I have a user from that unfortunately has become very long. Therefore
I need a scrollbar so that the user shall be able to scroll his/her way down
to the end of the user form. I found something that looked like a scrollbar
in the tools for the user form but I do not know how to write code for it and
my help function for vba does not work. Please if you know how to write code
for this, help me out! Thank you!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Scroll bar

Yes thank you! I did not know that there was a scroll bar
property..Unfortunately me hlep function in vba does not work and I am not
very good at this but I managed to show a scroll bar. However I do not think
it works. I do not see the small box on the scroll bar that you should be
able to pull up/down instead of using the arrows at the top/bottom. My code
is:

Private Sub UserForm_Initialize()
Me.ScrollBars = fmScrollBarsVertical
........

I would be very thankful if you could help me with problem! Thanks again
Tom! You save my life on a daily basis!
"Tom Ogilvy" skrev:

Or you could put this in your initialize event for the Userform:

Private Sub UserForm_Initialize()
UserForm1.ScrollBars = fmScrollBarsVertical
UserForm1.ScrollHeight = UserForm1.Height
UserForm1.Height = UserForm1.Height / 2
End Sub

This assumes in the VBE you can see the entire userform.

--
Regards,
Tom Ogilvy


"Viktor Ygdorff" wrote:

Hello! I have a user from that unfortunately has become very long. Therefore
I need a scrollbar so that the user shall be able to scroll his/her way down
to the end of the user form. I found something that looked like a scrollbar
in the tools for the user form but I do not know how to write code for it and
my help function for vba does not work. Please if you know how to write code
for this, help me out! Thank you!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Scroll bar

Use the code I provided. the scroll bar doesn't work until you make the
scrollheight equal to the actual height and then make the actual height to
something less. I made it 1/2 of the original height (so half the height is
always in view), but you can make it something else.

--
Regards,
Tom Ogilvy


"Viktor Ygdorff" wrote:

Yes thank you! I did not know that there was a scroll bar
property..Unfortunately me hlep function in vba does not work and I am not
very good at this but I managed to show a scroll bar. However I do not think
it works. I do not see the small box on the scroll bar that you should be
able to pull up/down instead of using the arrows at the top/bottom. My code
is:

Private Sub UserForm_Initialize()
Me.ScrollBars = fmScrollBarsVertical
.......

I would be very thankful if you could help me with problem! Thanks again
Tom! You save my life on a daily basis!
"Tom Ogilvy" skrev:

Or you could put this in your initialize event for the Userform:

Private Sub UserForm_Initialize()
UserForm1.ScrollBars = fmScrollBarsVertical
UserForm1.ScrollHeight = UserForm1.Height
UserForm1.Height = UserForm1.Height / 2
End Sub

This assumes in the VBE you can see the entire userform.

--
Regards,
Tom Ogilvy


"Viktor Ygdorff" wrote:

Hello! I have a user from that unfortunately has become very long. Therefore
I need a scrollbar so that the user shall be able to scroll his/her way down
to the end of the user form. I found something that looked like a scrollbar
in the tools for the user form but I do not know how to write code for it and
my help function for vba does not work. Please if you know how to write code
for this, help me out! Thank you!

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
How do I turn scroll lock off (2007 excel)? No scroll lock key Cameron A Perth Excel Discussion (Misc queries) 1 September 18th 09 05:46 AM
Cannot scroll with a Scroll Point Mouse Jeff (North Carolina) Excel Discussion (Misc queries) 2 January 7th 09 07:39 PM
adding scroll bar to scroll on cell's content? Rotem Charts and Charting in Excel 0 November 16th 06 12:36 PM
Scroll horizontaly with mouse, create same system used to scroll . frederic New Users to Excel 5 October 9th 05 08:15 PM
Scroll the screen view with the scroll bar avbs Excel Discussion (Misc queries) 1 June 25th 05 04:43 PM


All times are GMT +1. The time now is 09:55 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"