+ Reply to Thread
Results 1 to 6 of 6

Worksheet Events Not Working Consistenly

  1. #1
    Registered User
    Join Date
    03-16-2004
    Location
    UK
    MS-Off Ver
    2003
    Posts
    85

    Worksheet Events Not Working Consistenly

    All,

    I have been working with Worksheet_SelectionChange and Worksheet_Change events. They start of working and then they stop, sometimes after a de-bug and sometime after a change on the worksheet. If I save and close the workbook and open it again it is fine. Can anybody tell me what is happening and suggest a fix?

    An example of my code...

    Please Login or Register  to view this content.
    Phil

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Did you copy & paste the code into your posting or type it in

    Your posted code has a couple of errors init that will cause it to error & not run at all

    Please Login or Register  to view this content.
    should be
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    should be probally be
    Please Login or Register  to view this content.
    Not shure what you are trying to do with using Name twice
    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You also need to add On Error GoTo 0 at the end to return error handling to Excel
    Last edited by royUK; 01-07-2009 at 07:40 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302
    If you Debug and press Stop, your code will not run to the end and events will be disabled. Restarting Excel will reset that.
    You would only use On Error Goto 0 if you wanted to disable all error handlers, which is presumably not the case here.

  5. #5
    Registered User
    Join Date
    03-16-2004
    Location
    UK
    MS-Off Ver
    2003
    Posts
    85

    ?

    Thaks that's helpful.
    Is there any other way to reset the events without closing and opening the workbook?

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302
    Yeah you can just type:
    Please Login or Register  to view this content.
    in the Immediate Window and press enter. I have two one-line subs for turning events on and off when I'm debugging.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1