Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have some code that is triggered when the user selects a sheet within a
workbook. It redraws a menu, which changes from sheet to sheet. The problem is that this takes some time to run, and when you're running functions that cycle through the sheets (and we have lots of these) the delay while the menu redraws actually becomes a significant time waster. So what I'd like to do is have this code fire not when the workbood simply changes tabs, but when the USER does this. Any ideas? Maury |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
2 suggestions:
1. 99% of code does not needto activate/select anything, so change your code to reflect this (post a small section of your code and I/someone will show you the equivalent). 2. Use Application.EnableEvents=False/True carefully. -- p45cal "Maury Markowitz" wrote: I have some code that is triggered when the user selects a sheet within a workbook. It redraws a menu, which changes from sheet to sheet. The problem is that this takes some time to run, and when you're running functions that cycle through the sheets (and we have lots of these) the delay while the menu redraws actually becomes a significant time waster. So what I'd like to do is have this code fire not when the workbood simply changes tabs, but when the USER does this. Any ideas? Maury |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't think you can trap for (or would want to ) when just the user changes
at the beginning of your code put in application.screenupdating=false and change back to true at end, untested but i believe that will keep any menus from drawing. -- -John Please rate when your question is answered to help us and others know what is helpful. "Maury Markowitz" wrote: I have some code that is triggered when the user selects a sheet within a workbook. It redraws a menu, which changes from sheet to sheet. The problem is that this takes some time to run, and when you're running functions that cycle through the sheets (and we have lots of these) the delay while the menu redraws actually becomes a significant time waster. So what I'd like to do is have this code fire not when the workbood simply changes tabs, but when the USER does this. Any ideas? Maury |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just create a public variable which the worksheet event routine tests for,
and set and reset in your looping code, or even use Application.EnableEvents. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Maury Markowitz" wrote in message ... I have some code that is triggered when the user selects a sheet within a workbook. It redraws a menu, which changes from sheet to sheet. The problem is that this takes some time to run, and when you're running functions that cycle through the sheets (and we have lots of these) the delay while the menu redraws actually becomes a significant time waster. So what I'd like to do is have this code fire not when the workbood simply changes tabs, but when the USER does this. Any ideas? Maury |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
Change default in input box from "20" to "000000"? Have macro continue on to name sheet tab? | Excel Programming | |||
Please add a "sheet" function like "row" and "column" functions | Excel Programming | |||
Sheet turns into a "ThisWorkbook" module | Excel Programming |