+ Reply to Thread
Results 1 to 3 of 3

Worksheet_Change not working

  1. #1
    Registered User
    Join Date
    01-05-2007
    Posts
    4

    Angry Worksheet_Change not working

    So i'm trying to get this spreadsheet to make some simple calculations whenever there is a change in the worksheet. Can anyone explain to me why this code DOESN'T work? It is not running (I have used the debugger and a msgbox to make sure) when there is ANY change in the workbook, whether formulaic or a manual change. Can anyone please help?

    Please Login or Register  to view this content.
    Last edited by VBA Noob; 01-08-2007 at 06:24 PM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    The Application.EnableEvents may have been turned off by

    Application.EnableEvents = False

    and not turned back on by

    Application.EnableEvents = True

    This can happen if a macro crashes or is stoped before it gets to the
    Application.EnableEvents = True line of code.

    Your code uses several Exit Sub commands which will stop it getting to the
    Application.EnableEvents = True command


    Try
    putting this macro on the same sheet module as your Worksheet_Change(ByVal Target As Range) macro and then run ReactivateEnableEvents.

    This will re-enable the event triggers

    Please Login or Register  to view this content.

    you will need to modify your code to ensure that it always Application.EnableEvents = True before exiting the macro by either adding the command before each Exit Sub or by using a goto command

    Example on using Goto command
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-05-2007
    Posts
    4
    thank you very much

+ 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