+ Reply to Thread
Results 1 to 3 of 3

freezing and passing SelectionChange event value

  1. #1
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    freezing and passing SelectionChange event value

    I created a macro that adds the current date to a cell if anouther range has a change. I did this using the Worksheet_Change event. I also setup a list for the cells using data validation. If the user enters an incorrect value a warning occurs providing the option to continue or cancel. One problem is that the date cell updates even if the user cancels from a Data Validation Warning for an incorrect value entry, and makes no ACTUAL change. I want to have the date update only when a real change to the value is made. To prevent this I am trying to capture the Target cell value before the change and compare it to the value after the change.

    I set the public variable selChgTgt in the Worksheet_SelectionChange event
    and make the comparison, in the Worksheet_Change, right before calling the date change code.

    However, the variable is being changed while the Worksheet_Change event is running even though it was set during the Worksheet_SelectionChange event. This is causing my test "If Not Target = selChgTgt Then" to always return "0" and exit.

    Im attaching the workbook, if you care to look. For ease of testing, the area to make changes to is Input!$B$3:$B$1245 the date column is a few columns to the right.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    So far I cannot upload the file. I can email it if anyone is interested.
    Thanks
    Robert
    Last edited by Hammer_757; 03-23-2012 at 10:09 AM.

  2. #2
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: freezing and passing SelectionChange event value

    ive tried to upload the file several times. the status bar advances and looks like it complete but the file does not show up in the selection pane. It may be a network issue here at work. I will try to upload from home tonight.

  3. #3
    Forum Contributor
    Join Date
    03-21-2004
    Location
    Norwich, CT USA
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: freezing and passing SelectionChange event value

    This question was resolved in a new thread http://www.excelforum.com/excel-prog...html?p=2740678

+ 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