• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Cell Hint

Somewhere on Chandoo's site I once saw a tip that would use vba to place a cell hint in a cell. For example, if the user where suppose to enter a first name in cell A1, the cell would have the words First Name in it. I did a search but could not find the article.
 
Depending on what your input is you could do it by using a custom format. For instance a format of #,##0.00;-#,##0.00;"Type a positive number" would show Type a positive number if you put a 0 in the cell and it would show the formatted number if any non zero number were keyed in the cell.
 
Check the attached...and both tabs, one is using conditional formatting the otht one is using data validation
 

Attachments

  • Hints.xlsx
    9.8 KB · Views: 0
Thanks, the conditional formatting approach is the look I wanted, but the hint is only there before the first entry. I am using a set of cells to enter name and address information, G12:H17, then clearing the range before entering a new set of information, so I need the hints to reappear. The data validation approach accomplishes this, but doesn't have the look I was looking for.
 
In that case the only way out is VBA AFAIK...let me know if what Khalid has posted doesnt help..
 
Thanks Khalid, that was the page I was looking for.
What would the code look like to place default text in the cell to, be able to enter data, then clear the cell and see the default text again.
 
Thanks Khalid, that was the page I was looking for.
What would the code look like to place default text in the cell to, be able to enter data, then clear the cell and see the default text again.

Using Chandoo's example... (http://chandoo.org/wp/2012/07/11/highlight-row-column-of-selected-cell-using-vba/)

I think you can do this with CF,
Just amend the existing CF Rule as:
=AND(selRow=ROW($E$23),selCol=COLUMN($E$23),ISBLANK(E23))
Bold part amend, this will ensure to apply condition if the cell is blank too.

Regards,
 
I think I need to do it with vba, I want the hint to be shown in cell that I will enter the text into, then when I delete the text in the cell, the hint reappears. Thanks for the help.
 
Back
Top