VBA User Forms videos | Excel VBA Forms Pt 10 - Scroll Bar Controls

Posted by Andrew Gould on 31 March 2016

A Scroll Bar is like the big brother of a Spin Button, allowing you to set a numeric value by clicking and dragging a bar. This video shows you how to use a scroll bar to control both a numeric value and a date.

You can download any files that you need to follow the video here.

You can increase the size of the video:

Full screen mode for YouTube

You can view the video in full screen mode as shown on the left, using the icon at the bottom right of the frame.

You can also increase the quality of the video:

Changing resolution

You can improve the resolution of the video using another icon at the bottom right of the frame. This will slow down the connection speed, but increase the display and sound quality. This icon only becomes visible when you start playing the video.

Finally, if nothing happens when you play the video, check that you're not using IE in compatibility view.

This page has 1 thread Add post
27 Aug 20 at 17:33

Hi Andrew,

I think I made scroll increase in month increment if clicked on right side using below code

Private mCurrentScrollPos As Long
Private Sub FilmDateScroll_Change()

FilmDate.Text = Format(CDate(FilmDateScroll.Value), "d mmm yyyy")
    
If (FilmDateScroll.Value < mCurrentScrollPos) Then
    
        FilmDateScroll.LargeChange = DateDiff("d", _
                                                DateAdd("m", -1, CDate(FilmDateScroll.Value)) _
                                                , CDate(FilmDateScroll.Value))
Else
        FilmDateScroll.LargeChange = DateDiff("d", _
                                        CDate(FilmDateScroll.Value), _
                                        DateAdd("m", 1, CDate(FilmDateScroll.Value)))
End If
    
mCurrentScrollPos = FilmDateScroll.Value
                                           
End Sub

 

Let me know if there is something else I should consider.

Thanks,

Surendra