LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to get looping VBA code to respond to events on worksheet

Hello,

I have some code of the form

do while not g_Paused
bunch of calls
...
loop

where I'd like the variable g_Paused to be toggled by a button on the
worksheet. The only way I can seem to get the code to respond to the
button click is to use

do while not g_Paused
bunch of calls
...
ThisWorkbook.Worksheets("Name").Activate
DoEvents
loop

But this is pretty slow and causes the sheet to flicker...is there a
better method?


PS


I'm using buttons from the Control Toolbox


Thank you.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting .NET form to respond to Excel window events [email protected] Excel Programming 1 May 2nd 07 02:25 PM
Force event code to NOT respond Peter Danes Excel Programming 7 August 7th 06 03:12 PM
Worksheet events and a little bit extra code tinkerbellsmyhoe Excel Programming 3 April 27th 06 02:52 PM
worksheet tabs do not respond to grouping Cleared for Take-Off Excel Discussion (Misc queries) 3 November 1st 05 12:36 AM
excel.application.run macro1 -- added code to respond "yes" to a inputbox Michael Joe Excel Programming 3 August 13th 04 10:11 PM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"