View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
monkeyboy[_2_] monkeyboy[_2_] is offline
external usenet poster
 
Posts: 2
Default How to get looping VBA code to respond to events on worksheet

Sorry, I should have been more explicit. I have a button on the
worksheet that sets g_Paused to TRUE, then calls the loop procedure. I
also have an "Pause" button on the worksheet that sets g_Paused to
FALSE. Once I enter the loop procedure however, the code no longer
responds to buttons on the worksheet, unless I say
"ThisWorkbook.Worksheets("Name").Activate ". When in the IDE, it
appears as if the event is firing as I can see the worksheet module
flicker when I push the "Pause" button, but the global g_Paused
doesn't seem to be set to FALSE? I have my code arranged in several
modules, with PUBLIC procedures and PUBLIC globals. I'll try using a
Form, but I don't understand what is stopping the worksheet event from
setting the variable...