Scroll bar update

A

art

Hello:

I have this code for a scroll bar to change the active sheets:

Private Sub ScrollBar1_Change()
UserForm1.Label1.Caption = ScrollBar1.Value
MySheet = UserForm1.ScrollBar1.Value
MySheetName = "Sheet" & MySheet
Sheets(MySheetName).Select
End Sub

However I would like that the active sheet should change while I'm draggind
up or down. As of now only when I click on the "up" or down arrow, then it is
considered a change and updates itself. But I need it to change while
dragging up and down as well.

Please help.

thanks.
 
D

dbKemp

Hello:

I have this code for a scroll bar to change the active sheets:

Private Sub ScrollBar1_Change()
    UserForm1.Label1.Caption = ScrollBar1.Value
    MySheet = UserForm1.ScrollBar1.Value
    MySheetName = "Sheet" & MySheet
    Sheets(MySheetName).Select
End Sub

However I would like that the active sheet should change while I'm draggind
up or down. As of now only when I click on the "up" or down arrow, then it is
considered a change and updates itself. But I need it to change while
dragging up and down as well.

Please help.

thanks.

Add the code to the Scrollbar Scroll event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top