ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling worksheet_change when running a specific macro . . (https://www.excelbanter.com/excel-programming/353470-disabling-worksheet_change-when-running-specific-macro.html)

Adam[_14_]

Disabling worksheet_change when running a specific macro . .
 
Hi,
I have a macro that does a series of copy & pastes inside the module
code. How do I prevent this macro from firing a series of events in the
worksheet_change() in the worksheet code?

BTW, I have a condition for Application.cutcopymode = 0, which
correctly disables manual copy and paste.

The macro that I have running in the module code is called Sub
InsertProj

This is what I expect my worksheet_change() code to look like . . .

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("W:W")) Is Nothing Then
If Application.CutCopyMode = 0 Then
If <* Condition to disable macro "Sub InsertProj" * = 0 Then
<< Event
End If
End If
End If

I need to know how to write the <* Condition to disable macro "Sub
InsertProj" * = 0

Thanks!
Adam


Adam[_14_]

Disabling worksheet_change when running a specific macro . .
 
Never mind . . . Should've spent more time googling before posting that
.. . .
Fixed it with

sub InsertProj
Application.EnableEvents = False
<< Code
Application.EnableEvents = True
end sub

on my macro . .



All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com