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

Hi How do i use the worksheet change sub but not have it
fire until after the report is created.

as at the moment each time a cell is written to when
report is being created it just messes up
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Worksheet_change

If you're creating the report in code, wrap your report generation
code with

Application.EnableEvents = False
'Do report stuff here
Application.EnableEvents = True

You'll then need to have one last change to fire the
Worksheet_Change() macro.


In article ,
"Andrew haycock" wrote:

Hi How do i use the worksheet change sub but not have it
fire until after the report is created.

as at the moment each time a cell is written to when
report is being created it just messes up

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Worksheet_change

"Andrew haycock" wrote in message
...
Hi How do i use the worksheet change sub but not have it
fire until after the report is created.

as at the moment each time a cell is written to when
report is being created it just messes up


Hi Andrew,

That depends on what's writing to your cells. If you are running a VBA
program that's doing the writing and causing this event to fire, then add
the following line at the beginning of the code:

Application.EnableEvents = False

and when you are ready for the Worksheet_Change event to fire again add the
line:

Application.EnableEvents = True

If the user is entering data on the worksheet and causing the
Worksheet_Change event to fire then there isn't much you can do. This is
what the event was designed for.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *



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
Sub Worksheet_Change Matt Excel Discussion (Misc queries) 3 November 16th 07 04:40 PM
Worksheet_change won't run Eric Excel Discussion (Misc queries) 4 March 10th 05 03:43 PM
Worksheet_Change Job[_2_] Excel Programming 1 August 13th 03 03:23 AM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


All times are GMT +1. The time now is 01:10 AM.

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"