Macro; need to disable one when another is running

ed.ayers315

Board Regular
Joined
Dec 14, 2009
Messages
166
Hi Folks,

I need to disable or not allow one certian macro from running when another is running.

I reviewed previous posts and found
Code:
Application.Enable.Events = False

Unfortunately this disables other item I do need to run Like Spell Check.

When this macro
Code:
Sub COMPILE_VESSEL_DATA()
is started

I do not want this change event to run
Code:
Private Sub Subject_Title_51C_V1_Change()

Any suggestions
 

Some videos you may like

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,970
You could declare a Public variable

Code:
Public Abort as Boolean

Sub COMPILE_VESSEL_DATA()
    Abort = True
    
    Rem code

    Abort = False
End Sub

Sub Subject_Title_51C_V1_Change()
    If Abort then Exit Sub

    Rem code
End Sub
 

ed.ayers315

Board Regular
Joined
Dec 14, 2009
Messages
166
mikerickson, thanks for the advice

I did not get that to work so I went with a workaround, not what I wanted but it will do.

Have a great weekend.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,674
Messages
5,626,210
Members
416,168
Latest member
tttt199623

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
Top