+ Reply to Thread
Results 1 to 3 of 3

Double Click Event to change and limit other cells

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    64

    Double Click Event to change and limit other cells

    DoubleClickEvent.xlsxHello all

    I've attached a file to help demonstrate what i'm tryng to achieve, and as usual any help is gratefully received and appreciated.

    In the attached file are 10 options available to five different users. So far I have some VBA code set up so that any cell double clicked in the range C3 to G12 will toglle between 'Yes' and 'No' values. All well and good so far...

    What I want to be able to do now though is the following - if Option1 is selected 'Yes' for any given user (so in this example let's use User2, in column D), that this change will cause two things to happen:

    1) it will change all other options for that particular user (ie: from Option2 to Option10) to a 'No' value.
    2) it will then stop the double click event working if you then try to change one of those options to a 'Yes' while option 1 is still set at 'Yes'.

    For reference this is the VBA I'm using so far just to deal with the Yes/No toggle:

    Please Login or Register  to view this content.
    Can anyone help please??

    Thanks
    Kenny

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Double Click Event to change and limit other cells

    First, the file you attached is not macro-enabled. It would be helpful when you have a file with a macro to post the actual file. Also the data in the attached file does not match your description; it only has two columns of responses.

    Here is code that will work for what you described. I don't know where you got Range("l30:cd48") but I changed it to the range you described.

    In this case, if the user double-clicks when Option 1 is Yes, then the default action will occur, which is opening the cell for editing. If you do not want to do that, then don't change Cancel to False. Leaving it True will simply result in nothing at all happening after the double-click.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-01-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2010
    Posts
    64

    Re: Double Click Event to change and limit other cells

    Hi 6StringJazzer

    Apologies for my original post, I was in a rush to get it submitted while at work and since reading it back I realise a lot was wrong about it! However I've just tested your code however and it works perfectly, thank you very much indeed

    Kenny

+ 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