Update scrollbar in code without causing change event

S

Sandra

I have a number of scrollbars embeded in a worksheet which have change
events associated with them to update a table and a chart based on the
scrollbar values.

However, I have a 'show me' demo for the user, showing the scrollbar
moving but I don't want the table and the chart to be automatically
updated. Whenever I change the value of the scrollbar in my code, the
scrollbar change event is triggered.

Is there any way this can be turned off until the demo is finished?

Any help most appreciated!
 
T

Tom Ogilvy

Have each change event check a "flag" before executing

For example:
Private sub Scrollbar1_Change()
if Worksheets("Hidden").Range("A1") = 1 then exit sub

End Sub


Then have your demo set Worksheets("Hidden").Range("A1") to 1 at the start
and back to zero at the end.
 
S

sandra.campbell

Thanks for that - this was the only type of approach I could come up
with as well, so I presume it's not possible to 'turn off' change
events for controls like scrollbars etc?
If not, I'll go with the flag idea! Thanks
 
T

Tom Ogilvy

No, it isn't provided for.

Application.EnableEvents is in the Excel object library. Scrollbars are in
the MSForms object library, so EnableEvents doesn't affect them.
 

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