![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
hello everyone...
I asked this before, but didn't have any luck. I would like to do the following: have a certain piece of text (ie- "enter age here") in cell A1, unless the user enters their age there. When it is deleted, I would like the text to reappear (ie. "enter age here") In other words, this text would be a placeholer that informs the user of what to enter, dissappears when the user enters the text, and then reappears when the information is deleted from the cell. Any ideas? Thanks in advance!!! |
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 1,802
|
Type this into the worksheet_change module:
If Range("A1").Value = Empty Then Range("a1").Value = "Enter text here" End If Hope that helps. Giacomo |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hi, Assuming that your age is entered into cell B1 - you could put the following formula into cell A1:
cell A1 = if(B1="","Enter Age Here","") Hope this helps. |
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Enter the formula, =IF(ISBLANK(B1),"Enter Age Here",""), into A1. Set the Column width of column A to 0.08.
[ This Message was edited by: Mark W. on 2002-02-25 11:18 ] |
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
No luck...perhaps I am doing something incorrect...I don't see the text in the cell after putting in this code. Maybe I am putting the code in the wrong area, or I am missing a few steps? Can you explain it any more? Thanks, sorry for the trouble!
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
The following post works:
Enter the formula, =IF(ISBLANK(B1),"Enter Age Here",""), into A1. Set the Column width of column A to 0.08. Except, once a number is entered and then deleted, so is the formula. I am look for a solution like that above, but when the number is deleted, the "enter age here" is once again displayed, etc. Thanks guys! |
|
|
|
#7 |
|
Board Regular
Join Date: Feb 2002
Posts: 1,802
|
the code I gave you should work whenever the worksheet has changed. You may have to hit "F9" to make it appear the first time. Then after that it should work fine.
Giacomo |
|
|
|
|
|
#8 |
|
Guest
Posts: n/a
|
giacomo,
Still no luck..I've tried "F9", and it doesn't appear. I really still want to make this work though. Maybe I am putting the code in the wrong place...can you explain in more detail? Also, right now the cell (A1) is emtpy too...do I need to type in "enter age here" into the cell first? Any further suggestions/help would be great....Thanks! |
|
|
|
#9 |
|
Board Regular
Join Date: Feb 2002
Posts: 1,802
|
Well, I tested pressing F9 and it didn't work for me either, sorry. If you enter a number into cell A1 and then delete it, it should work however. Actually if you type something anywhere and delete it should work.
I entered the code by right-clicking on the worksheet tab and pressing "view code". Then by default I get the "Worksheet_SelectionChange" sub, you have to click on the drop down box that says "Selection Change" and choose just "Change", after you do this you'll probably see both the "Worksheet_SelectionChange" and the "Worksheet_Change" subs. Paste the code in the Worksheet_Change sub above where it says "end sub". email me at giacomo22@hotmail.com, if you're still having problems. I'll send you a test sheet. Giacomo |
|
|
|
|
|
#10 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
No, it isn't because you reserve column A for the formula and you enter the value in column B. When column A's width is set to 0.08 it gives the illusion that "Enter Age Here" is in the adjacent cell. [ This Message was edited by: Mark W. on 2002-02-25 12:41 ] |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|