Is there a do not call function?

P

pokdbz

For some reason a function is calling this:
Worksheet_SelectionChange(ByVal Target As Range)

I don't want it to call this function. Is there a way to make it so it
doesn't call this function if there is a selection change?
 
R

Ron Coderre

In the Sheet Module containing the code:
Either
1) comment out that event code
or
2) delete it

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
C

Chip Pearson

Excel will automatically call the Worksheet_SelectionChange procedure when
the selection is changed (e.g., by clicking on a cell) either manually or by
other code. You can prevent event procedures from running with the
Application.EnableEvents property.

Application.EnableEvents = False
'
' your code here
'
Application.EnableEvents = True

However, it is very rarely required that you Select anything when working
with VBA. Instead, you can reference a range directly. For example,

Instead of
Range("A10").Select
Selection.Font.Bold = True

Use
Range("A10").Font.Bold = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
Top