+ Reply to Thread
Results 1 to 8 of 8

Placeholder text

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    Antwerp
    MS-Off Ver
    2019
    Posts
    71

    Placeholder text

    Hi there,

    I have the following code for a placeholder text in a cell that disappears when it is overwritten but should reappear when the cell was deleted and thus empty.

    This code has two issues. My question is if some of you experts could solve them.

    1st issue: When the cell is deleted, the placeholder text does not show up immediately. You have to double click the empty cell before the placeholder text reappears. How to make it show immediately?
    2nd issue: When I (accidentally) double click the gray placeholder text, it turns black like the font color of the text to be overwritten. How to keep the placeholder text to stay gray, even after double clicking on it.

    Thanks!

    Please Login or Register  to view this content.

  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: Placeholder text

    I used your code and did not experience any delay in restoring the placeholder text after deleting. You may have to provide your actual file, as there may be more going on than what you provided here.

    If your code sees a change to a cell and the result is non-blank, it turns the text black. If a cell has the gray prompt, and you double click (or hit F2), Excel interprets this as a change to the cell, even if you did not actually change the text. Your code changes that black, too. Make this change in your code to avoid that.

    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
    07-01-2015
    Location
    Antwerp
    MS-Off Ver
    2019
    Posts
    71

    Re: Placeholder text

    Thanks for your reply, StringJazzer. I used your code and it did solve issue 2 but issue 1 remains the same. The text "Name Player 1" only gets restored after double clicking the empty cells concerned.

    How could I also integrate a second range in the VBA code with the prompt message [NAME PLAYER 2]? (The range is mentioned in the file.)

    I attached the file.

    Thanks
    Attached Files Attached Files

  4. #4
    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: Placeholder text

    You have run into one of the classic problems with using merged cells, which many of us here consistently recommend against using. Your code checks to make sure only one cell has changed:
    Please Login or Register  to view this content.
    but when you delete a merged cell, you have changed 15 cells. So your code exits.

    You can either reformat your sheet to avoid merged cells, or you can remove this test from your code. Although the first one is a better overall solution, the second one is probably easier.

    This code will work no matter how many cells are changed, but it iterates through every changed cell individually.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-01-2015
    Location
    Antwerp
    MS-Off Ver
    2019
    Posts
    71

    Re: Placeholder text

    Thanks Stringjazzer. I merge cells because I think the standard cell size is too big :/ Your code works perfect.

    How could I integrate a second range in the worksheet_change (X17:X26,BK17:BK26,AB29:AB32) for "Name Player 2"?

    Thanks

  6. #6
    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: Placeholder text

    Try this, I didn't have time to run a test:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-01-2015
    Location
    Antwerp
    MS-Off Ver
    2019
    Posts
    71

    Re: Placeholder text

    You sir, are a pro! It works swiftly. Thanks!

  8. #8
    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: Placeholder text

    Thanks for the rep! Please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

+ 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. [SOLVED] Default template placeholder text
    By Kyle123 in forum PowerPoint Formatting & General
    Replies: 1
    Last Post: 03-15-2017, 10:08 AM
  2. Picture Placeholder
    By ejohnson23 in forum Excel General
    Replies: 1
    Last Post: 02-13-2015, 03:46 PM
  3. Replace Placeholder Text
    By domino01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2013, 11:52 AM
  4. Placeholder / formula help
    By mogomoss in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 10-23-2011, 07:44 PM
  5. Graphic shows placeholder only
    By NMullis in forum Excel General
    Replies: 4
    Last Post: 10-13-2008, 05:05 PM
  6. delete row of text with 3 macros & [placeholder]
    By Janis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-18-2006, 03:30 PM
  7. zero placeholder
    By cwilken in forum Excel General
    Replies: 2
    Last Post: 05-19-2005, 02:48 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