+ Reply to Thread
Results 1 to 6 of 6

Worksheet SelectionChange not working

  1. #1
    Registered User
    Join Date
    07-18-2014
    Location
    Atlanta, GA
    MS-Off Ver
    10
    Posts
    65

    Worksheet SelectionChange not working

    I had this working and I have no idea what I did or what happened but now it will not work. When I drop the formula back into the Spreadsheet it works fine... So, it has to be some way in which I am calling the function improperly.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Worksheet SelectionChange not working

    Hi HJHamm,

    Debugged the code works fine..Can you share the sample sheet for furthur testing?
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Worksheet SelectionChange not working

    You can combine two of the Ifs. Consider putting Application.EnableEvents=False at the beginning and set it to True at the end.

    Normally, most like to use Intersect() to see if the Target was changed to fire the event.

    Note, change events don't fire for calculated cells.

  4. #4
    Registered User
    Join Date
    07-18-2014
    Location
    Atlanta, GA
    MS-Off Ver
    10
    Posts
    65

    Re: Worksheet SelectionChange not working

    I just opened up the file and it works as expected... so, Kenneth is this due to your point; "EnableEvents"?
    Attached is the file anyway...
    Attached Files Attached Files

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Worksheet SelectionChange not working

    Could be.

    Try this on a copy and see if it helps with maintaining code. Looping is often the better choice when you see many patterns.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2505
    Posts
    2,790

    Re: Worksheet SelectionChange not working

    HJHamm;4110559]I had this working and I have no idea what I did or what happened but now it will not work. When I drop the formula back into the Spreadsheet it works fine... So, it has to be some way in which I am calling the function improperly.
    Hi HJHamm,

    I thought I would point something out to you just to make sure you understand what's happening.

    You have chosen the selectionchange event to fire your code. The selection change even fires when you select a cell other than the one that was already selected. You can do this by clicking on another cell or hitting enter which moves you to a different cell. Having said this I thought maybe what you were doing is something like what I am going to describe.

    Let's say Cell A1 is selected and I click in your cell C2, the drop down list. As soon as I click in that cell the code fires, but you see no change because the drop down is the same as it was the last time the code was run. If I now simply change the value in the drop down but don't hit enter or click on another cell then the code doesn't fire so it appears as if what I have don't didn't do anything. If I change this cell and then click on K2 the other drop down I see a change from what I did with the first drop down and I think things are fine, but I click on the second drop down, the code fires, I change the second drop down but don't click on a cell outside the drop down or hit enter then nothing happens and I may think there's an issue and the code doesn't work, it works it just didn't fire because I have to actually leave the drop down to fire the code.

    I don't know if this is what you were seeing or not but I just thought I would throw it out there, if this is not the issue maybe you could go into more detail.

    Good Luck.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. WorkSheet SelectionChange on a worksheet that doesnt yet exist
    By Johan99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2014, 10:56 AM
  2. [SOLVED] SelectionChange Event Not Working Properly
    By msawyer in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-14-2013, 05:20 PM
  3. SelectionChange worksheet with too many macros
    By Scott N in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-11-2013, 10:10 PM
  4. SelectionChange stops working
    By andym in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2006, 06:00 PM
  5. Worksheet SelectionChange Event
    By mjack003 in forum Excel General
    Replies: 2
    Last Post: 05-08-2006, 03:35 PM

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