Closed Thread
Results 1 to 4 of 4

Worksheet Events Not Working Consistenly

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

    Question 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...

    #
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    On Error Goto Error Handler

    NmRng = Target.Name.Name
    Application.EnableEvents = False

    If Left(NmRng, 3) = "INP" Then
    NmVal = Target.Value
    NewVal = InputBox("Enter New Value", "Updtate Parameter)
    End If

    ErrorHandler:
    Application.EnableEvents = True
    End Sub
    #
    Phil

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    You need to select the code & use the button marked #, not type #
    Last edited by royUK; 01-07-2009 at 06:57 AM.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-16-2004
    Location
    UK
    MS-Off Ver
    2003
    Posts
    85
    Apologies, please delete this version, I have re posted.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Don't duplicate the reply, simply use the Edit button

Closed 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