text placeholder
Find bottlenecks in your Excel workbooks
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: text placeholder

  1. #1
    Guest

    Default

     
    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. #2
    Board Regular giacomo's Avatar
    Join Date
    Feb 2002
    Posts
    1,802
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #3
    Guest

    Default

    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. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5
    Guest

    Default

    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. #6
    Guest

    Default

    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. #7
    Board Regular giacomo's Avatar
    Join Date
    Feb 2002
    Posts
    1,802
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #8
    Guest

    Default

    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. #9
    Board Regular giacomo's Avatar
    Join Date
    Feb 2002
    Posts
    1,802
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #10
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    On 2002-02-25 11:28, Anonymous wrote:
    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!
    > ...once a number is entered and then deleted, so is the formula...

    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 ]

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com