View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Worksheet change

Andrew,

You can disable events with code such as the following:

Application.EnableEvents = False
'
' your code here
'
Application.EnableEvents = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com



"Andrew Haycock" wrote in message
om...
hi iam developing a report that uses the Private worksheet change
function. the code below i my test code this works but is there a way
that i can disable this the code whilst the report is created (as it
fires all the time as the report is run) and then reinitialise it
after the report is completed.

Sub Worksheet_Change(ByVal target As Range)
MsgBox "Hi"
End Sub

my aim is that the user can select a cell and change thew value then
the worksheet change function will work out if it is above or below
15% of anouther value and then apply the relevent formatting. this bit
i got sorted but need the worksheet change to be disabled up until the
report is built for the user. (user requests report so it is built
loads of times also data changes often)

please any help would be most appriciated

Andy