+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Reset Drop Down to Basic Value

  1. #1
    Registered User
    Join Date
    07-13-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    21

    Reset Drop Down to Basic Value

    Hi,

    I have made this excel where there is a drop down list created using data validation.

    What I want is that whenever I change the employee name in cell "B2" all the values of the drop down cells in cells from "B6 to B10" should change to "NO" whether they have NO or Yes as their value.


    I want this change while the excel is open and even on multiple occasions while the excel is open.

    Can anybody please help me on this.

    The file is attached for reference.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,448

    Re: Reset Drop Down to Basic Value

    You can do this with a Worksheet Change event monitoring cell B2:

    Please Login or Register  to view this content.


    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-13-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Reset Drop Down to Basic Value

    Quote Originally Posted by TMShucks View Post
    You can do this with a Worksheet Change event monitoring cell B2:

    Please Login or Register  to view this content.


    Regards
    Thank you so much TM Shucks.

    If you can do me a favour can you please explain what the "if intersect" code does / how does it work?
    I am pretty new to vb in excel and am learning through internet so am not good at it.

    Thanks for the solution, works perfectly man. I am so happy.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Reset Drop Down to Basic Value

    Any cell on a sheet can be changed, and any change will "trigger" the Worksheet_Change event macro.

    The Intersect() method is used to see if the cell changed happens to "intersect" with the cells you want to trigger the activities of the ws_change macro. If the intersect exists, it will continue, if the cell(s) changed happen to occur outside the watched cells, the macro will abort, not do anything.


    EDIT: Additional comments removed, this is a good solution.
    Last edited by JBeaucaire; 07-26-2011 at 04:27 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,448

    Re: Reset Drop Down to Basic Value

    @JBeaucaire: thanks for providing the explanation.

    @uditmathur: you're welcome. Thanks for the rep.

    Also note that Application.EnableEvents = False/True is used because you are making (more) changes to the sheet within the Change event. This prevents an unnecessary loop through the event handler.


    If this has answered your question, please mark your thread as Solved. See my signature for details or the FAQ.

    Regards
    Last edited by TMS; 07-26-2011 at 04:45 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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