Worksheet_Change

k209310

Active Member
Joined
Aug 12, 2002
Messages
382
I have a worksheet change function which automatically saves a worksheet every time that a name is entered in to a particular cell.

This function works fine. However every time a run another macro (i have several that gather requested information from databases) the macro again runs i assume due to the worksheet change function.

Is there a way around this little problem?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
At the beginning of your "other macro" put:

Application.EnableEvents = False

and at the end put:

Application.EnableEvents = True
 

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
Restrict your change procedure to only run when the particular cell is modified. For example, if you just want the procedure to run when cell A1 is changed, add the following at the start: -

If Target.Address <> "$A$1" Then Exit Sub
' Rest of your code

If your separate macro also modifies the cell, and you don't want the Change event to be triggered, then you could Application.EnableEvents = False at the start of your macro code, but make sure you set it back to True at the end.
 

Forum statistics

Threads
1,144,148
Messages
5,722,792
Members
422,458
Latest member
Muirzy

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