+ Reply to Thread
Results 1 to 5 of 5

Double click toggle between Y / N

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Double click toggle between Y / N

    I'm trying to add to my double click code that if I double click F2 and that it is currently N , then it should be changed to read Y , and vice-versa.

    Can someone advice with some VBA to satisfy this?

    Grateful for any help.

    Using Excel , Word and Access 2003 - For the whole of 2024

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Double click toggle between Y / N

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Double click toggle between Y / N

    Excellent - thanks.

    BTW , if I were to run this on a merged cell (F2:F3) , how could the code be amended to accommodate this?

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: Double click toggle between Y / N

    This one-liner is an alternate to using the Select Case structure for your original question...
    Please Login or Register  to view this content.
    As for your extended question, we just need to force the one-liner to look as the first cell in the merge...
    Please Login or Register  to view this content.
    Note: I am assuming this one-liner is in your DoubleClick event procedure along with another line of code setting the Cancel argument to True.

  5. #5
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: Double click toggle between Y / N

    OK thanks. This works too.

    I took your suggestion to expand the code to this :

    Please Login or Register  to view this content.
    This accommodates the merged cells and solves the issue.


+ 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. Need to fill a Sheet by "paint by click" (Double-click toggle value)
    By Foxcastle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-19-2019, 02:28 PM
  2. [SOLVED] Double Click one sheet and replicate Double Click "mark" on other sheets
    By jeffreybrown in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-14-2018, 08:43 AM
  3. [SOLVED] Double click a cell to toggle value
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-25-2018, 09:47 AM
  4. Changing cell properties with double click, then revert with another double click
    By mweber2525 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-01-2014, 01:40 PM
  5. Replies: 4
    Last Post: 09-30-2013, 04:32 PM
  6. Toggle BackColor of labels in Userform through "click" and "double-click"
    By ahmerjaved in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 02:08 PM
  7. VBA toggle between colours on double click
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2013, 10:27 AM

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