How to skip Worksheet_Change?

alee001

Board Regular
Joined
Sep 9, 2014
Messages
154
Office Version
  1. 2010
Platform
  1. Windows
Can I skip/disable a sub code before run my marco then recover it like as following:
Code:
Private Sub progress()
Skip run/disable Sub Worksheet_Change(ByVal Target As Range)
My Marco
Recover/enable Sub Worksheet_Change(ByVal Target As Range)
End Sub
 
Last edited:

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Code:
Option Explicit


Private Sub Worksheet_Change(ByVal Target As Range)


    My Macro


    'Rest of Worksheet_Change macro code here


End Sub
 
Upvote 0
Code:
Option Explicit


Private Sub Worksheet_Change(ByVal Target As Range)


    My Macro


    'Rest of Worksheet_Change macro code here


End Sub

You may be misunderstanding, I want to skip/disable the Worksheet_Change() tempoary during run Sub progress().

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
...other code
End Sub

Private Sub progress()
'skip/disabe Worksheet_Change()
...my marco
'recover/enable Worksheet_Change()
End Sub
 
Upvote 0
You can enable/disable events using EnableEvents.
Code:
' disable events
Application.EnableEvents = False

' your code/macro
MyMacro

' enable events
Application.EnableEvents = True
 
Upvote 0

Forum statistics

Threads
1,223,778
Messages
6,174,482
Members
452,566
Latest member
Bonnie_bb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top