Sub Worksheet_Change

vhanacek

New Member
Joined
Jul 12, 2005
Messages
42
Hi everybody
Does any SUB exist like "Sub Worksheet_Change" , but the sub should be called only if cells in some range of the sheet are changed?....to save the time
I use there a function which put some values into some cells, what means that the worksheet is changed again and the SUB is called again and again.
Thanks
 

Some videos you may like

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
Hi

Within the worksheet change event sub, turn off the events

application.enableevents = false

Then do you processing.

Remember to change it back again at the end of the sub

application.enableevents = true

It is often worthwhile to put in an error trap to make sure the events are turned on again just in case.

HTH

Tony
 

Watch MrExcel Video

Forum statistics

Threads
1,111,597
Messages
5,541,160
Members
410,543
Latest member
ExcelGlenn
Top