+ Reply to Thread
Results 1 to 3 of 3

Help with cell change based on criteria from another cell in same row.

  1. #1
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Help with cell change based on criteria from another cell in same row.

    Hey folks,

    I'm attempting to add in some VBA to a sheet with multiple buttons and forms and I'm a bit stumped.

    I'm attempting to do the following:

    Based on changes made to the form, if the user inputs a value in any cell from B53:B102 (ID # field), I want the corresponding Start Date field (E53:B102) on the same row to reflect today's date - but only if the start date is empty to begin with.


    I've added the following code to Worksheet_Change:

    Please Login or Register  to view this content.
    However, this takes the change into a loop and the application crashes and doesn't necessarily take the existing filled dates into consideration.

    Any help would be appreciated.

    Thanks in advance!

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: Help with cell change based on criteria from another cell in same row.

    Hi,

    You'll have to temporarily disable events like this:
    Please Login or Register  to view this content.
    You need some sort of error handling to ensure that events are re-enabled before the procedure finishes (otherwise it won't be called again).
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Help with cell change based on criteria from another cell in same row.

    Thanks Colin!

    I adjusted the code to exclude changes if there is an existing Start Date and also included an additional piece to input an End Date as well.

    Please Login or Register  to view this content.

    Not sure if there is better syntax to capture the filled in dates though. Either way, this is doing the trick.

+ 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