Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / December 2007

Tip: Looking for answers? Try searching our database.

Is there a do not call function?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pokdbz - 27 Dec 2007 15:52 GMT
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?
Ron Coderre - 27 Dec 2007 15:55 GMT
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)

> 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?
Chip Pearson - 27 Dec 2007 16:00 GMT
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

Signature

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

> 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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.