Excel 2003 upgrade problem.

B

BrianB

I have recently upgraded to Excel 2003 and wondered why some of my
macros are not working. I then discovered that where the macro moves
to another worksheet, it automatically runs the worksheet macro. So
if the worksheet macro says Goto R1C1 but the macro which is running
says goto range ClearInput, the function of the macro does not take
place as the worksheet macro has taken me elsewhere. I resolved this
problem by putting into my macro goto ClearInput and then adding a
second line of goto ClearInput but I am sure there must be a setting to
prevent the worksheet macro running.
 
D

Dave Peterson

You may find it easier to just disable events before you select a worksheet.

Application.enableevents = false
'do your stuff
application.enableevents = true

But there's lots of things (most???) that don't need you to select the sheet
first. You can just work on that worksheet directly.

(But if you're changing cells and that worksheet contains a _change event, then
..enableevents would be the way I'd avoid firing it.)

ps. I don't recall this being different in earlier versions of excel.
 
Top