+ Reply to Thread
Results 1 to 12 of 12

double-click to display / hide text in a cell

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    double-click to display / hide text in a cell

    Hello to all.
    is it possible for a macro to do this?
    double click in D4 and the text disappears another double clik and the text is displayed
    double-click in E4 and the text disappears another double clik and the text is displayed
    double click in F4 and the text disappears another double clik and the text is displayed
    double click must only work in these 3 cells.
    max_max

  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 to display / hide text in a cell

    What do you mean by "disappears"? Do you want the cell to be cleared? Or is it OK to change the font color so the value is not visible?

    If you want the cell to actually be cleared then the value must be stored someplace to be able to redisplay it. That probably means using a hidden sheet.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: double-click to display / hide text in a cell

    Possibly something like this, you would have to change the font color
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: double-click to display / hide text in a cell

    Hi davesexcel,
    your macro not work.
    max_max
    Attached Files Attached Files

  5. #5
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: double-click to display / hide text in a cell

    Would be better as 6stringjazzer says
    double-click the cell value to make it disappear
    then double-click on it to make it reappear
    max_max

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: double-click to display / hide text in a cell

    The you will have to store the value in another part of the sheet

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: double-click to display / hide text in a cell

    Hi davesexcel thanks you, your macro work!
    a change:
    There are united cells see attachment.
    max_max
    Attached Files Attached Files

  8. #8
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: double-click to display / hide text in a cell

    I have seen another problem: the cell text is given by a formula that then does not re-enter.
    max_max
    Attached Files Attached Files

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: double-click to display / hide text in a cell

    Merged cells do not work well with target.address, I can only get it to work one at a time.

    Your offset cells should not be merged.

    Here's a code you can use until you get a better solution.

    Please Login or Register  to view this content.

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: double-click to display / hide text in a cell

    Quote Originally Posted by max_max View Post
    I have seen another problem: the cell text is given by a formula that then does not re-enter.
    max_max
    This was the reason I wanted to change the color of the font......
    Don't merge cells you want to use code on.
    Last edited by davesexcel; 10-12-2017 at 08:55 AM.

  11. #11
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: double-click to display / hide text in a cell

    Hi davesexcel the your macro in pos#9 for merged cells work!
    Have you read the my post#8 for cells with a formula?

  12. #12
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: double-click to display / hide text in a cell

    Hello,
    I did not think about it, but it looks like it works.
    is right here?:

    Target.Offset(, 10) = Target.Formula

    Please Login or Register  to view this content.
    max_max

+ 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. Double click cell and cell contents display in a Window,Frame
    By SKooLZ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-08-2015, 07:21 AM
  2. 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
  3. Double click a cell, see a Pop up box, Enter Text, Box goes away when leave cell
    By Gossamerga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-01-2013, 02:09 PM
  4. Create macro upon double click cell display filter in new sheet
    By kamalhilmi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-14-2012, 07:40 AM
  5. Double click a cell to display something
    By zhshqzyc in forum Excel General
    Replies: 10
    Last Post: 01-24-2011, 05:31 PM
  6. Double Click merged cell to display userform -
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2009, 11:06 PM
  7. How do I code a cell to display the current date on double-click?
    By George in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2005, 01:06 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