Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Sheet Deactivate Loop

I run a series of checks on a worksheet (called "Input") before the user can
click on another sheet called "Output". If Input check outs, I want to
activate the Output sheet and exit the sub. However, this seems to run the
deactivate event for Input again and the macro loops for a while. Any
suggestions? Thanks -Jason

Sub Worksheet_Deactivate()
....
If iCounter = 0 Then
Sheets("Output").Activate
Exit Sub
End If
....

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Sheet Deactivate Loop

use

application.enableevents = false

"Jason Morin" wrote:

I run a series of checks on a worksheet (called "Input") before the user can
click on another sheet called "Output". If Input check outs, I want to
activate the Output sheet and exit the sub. However, this seems to run the
deactivate event for Input again and the macro loops for a while. Any
suggestions? Thanks -Jason

Sub Worksheet_Deactivate()
...
If iCounter = 0 Then
Sheets("Output").Activate
Exit Sub
End If
...

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Sheet Deactivate Loop

And don't forget to set it back to True at the end of your code...

Application.EnableEvents = True

--
Rick (MVP - Excel)


"Sam Wilson" wrote in message
...
use

application.enableevents = false

"Jason Morin" wrote:

I run a series of checks on a worksheet (called "Input") before the user
can
click on another sheet called "Output". If Input check outs, I want to
activate the Output sheet and exit the sub. However, this seems to run
the
deactivate event for Input again and the macro loops for a while. Any
suggestions? Thanks -Jason

Sub Worksheet_Deactivate()
...
If iCounter = 0 Then
Sheets("Output").Activate
Exit Sub
End If
...


Reply
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
Loop through sheets & filter main sheet using sheet name Les Excel Programming 4 May 20th 08 02:39 PM
Deactivate workbook commandbar for one sheet? [email protected] Excel Programming 3 October 18th 06 09:44 PM
Trouble with Sheet Deactivate macro CLR Excel Programming 4 August 19th 05 03:59 PM
Deactivate sheet Jay Northrop Excel Programming 5 July 22nd 05 03:13 PM
Sort sheet on sheet's Deactivate event BountyHunter Excel Programming 3 May 25th 04 08:31 AM


All times are GMT +1. The time now is 04:36 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"