Userform Scroll Bar Doesn't Update in Real time ???

D

dim

Hi folks,

I have a Scroll Bar in a UserForm and also a Label. The Scroll Bar is
controlling Cell B1 on my worksheet, which is formatted for numbers to zero
decimal places, and the Label also in my UserForm is Datalinked to Cell B1 to
display the spinners value. The spinner can display from 0 to 100.

When I run the form and move the spinner, the numbers in Cell B1 don't
change until after I click on a Userform element other than the spinner.
Obviously I need the numbers to change as the spinner is moved so I know what
number I'm at!

Here is a short video I did to show you my problem:


Any ideas how to fix this?

Thanks for any advice...
 
S

sebastienm

Hi,
Here it says that the update of a COntrolSource for the ScrollBar happens on
the LostFocus event.
<http://books.google.com/books?id=pA...ts=G6unsZAFIR&sig=pe-xlV8Y76Rjgr01kwNLPB8KAWs>

I was able to get the proper behavior by explicitely setting the focus to
another control on the form when _Change occurs. However, it make this other
control the active one, which you may not want.
''' Set focus to other control when _Change occurs
Private Sub ScrollBar1_Change()
CommandButton1.SetFocus
End Sub

Finally, you could just use the _Change event to change the cell (if the
form is modal and not modeless, else when changing the cell, you need some
code to update the Scrollbar.
 

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