Put Grayed Text Into Input Cells for Instructions which Reappears if Input is Deleted

  • I would like to have grayed-out text in some cells to give users short instructions for that particular cell. If they type something in that cell, the text they input is in plain dark black...but if they delete what they type, the cell goes back to having the grayed-out text.


    So just for an example, a cell might say ENTER LAST NAME. When the user starts typing in that cell, ENTER LAST NAME disappears and their text shows up in DARK BLACK. BUT if they delete what they typed, ENTER LAST NAME reappears.


    I suppose what I want is conditional formatting which allows me to add text if the cell is empty...but if conditional formatting allows you to 'format' with specific text, I can't find it.


    Does anyone have a suggestion?


    Thank you.

  • Re: Put Grayed Text Into Input Cells for Instructions which Reappears if Input is Del


    Insert this into sheet code

    Code
    1. Sub RangeSetEmpty()
    2. Replace_Blanks [A1:A10], "Enter Last Name"
    3. End Sub


    Apply the conditonal formats, you can go a step further and adding the above into a worksheet event change to do what you require.

  • royUK

    Closed the thread.