ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update scrollbar in code without causing change event (https://www.excelbanter.com/excel-programming/319368-update-scrollbar-code-without-causing-change-event.html)

Sandra[_5_]

Update scrollbar in code without causing change event
 
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!

Tom Ogilvy

Update scrollbar in code without causing change event
 
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.

--
Regards,
Tom Ogilvy

"Sandra" wrote in message
om...
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!




[email protected]

Update scrollbar in code without causing change event
 
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


Tom Ogilvy

Update scrollbar in code without causing change event
 
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.

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
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





All times are GMT +1. The time now is 01:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com