+ Reply to Thread
Results 1 to 7 of 7

Scroll bar

  1. #1
    Viktor Ygdorff
    Guest

    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. #2
    Tom Ogilvy
    Guest

    RE: 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. #3
    Tom Ogilvy
    Guest

    RE: 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. #4
    Viktor Ygdorff
    Guest

    RE: 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. #5
    Viktor Ygdorff
    Guest

    RE: 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!


  6. #6
    Viktor Ygdorff
    Guest

    RE: 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!


  7. #7
    Tom Ogilvy
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1