View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default How To Keep Worksheet_Change From Firing?

Try this:-

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Exit Sub
'Your code here
End Sub

Mike

"PeteCresswell" wrote:

In MS Access VBA code, I'm creating a spreadsheet and pushing some
WorkSheet_Change code into it.

But as I populate various cells - after adding the code - the event
keeps firing and I'm tripping over chicken-egg situations.

I guess the obvious is not to add the code until everything else is
done.. but I'm wary of yet another chicken-and-egg conundrum.

Is there any way to prevent event code from firing until I've finished
building the spreadsheet?