+ Reply to Thread
Results 1 to 7 of 7

Thread: Label cells with text which disappears on mouse click

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Label cells with text which disappears on mouse click

    Hello everyone,

    is it possible in Excel (> 2007) to label a cell, which might contain a number, with a text?

    The text should disappear when you activate the cell, respectively click on the cell.

    If this function exist, what is its name?
    Last edited by platzhirsch; 01-29-2012 at 10:22 AM.

  2. #2
    Valued Forum Contributor dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    New Delhi, India
    MS-Off Ver
    Excel 1997, 2000, XP, 2003, 2007, 2010
    Posts
    2,398

    Re: Label cells with text which disappears on mouse click

    Hi Platzhirsch,

    Welcome to the forum.

    Label a cell ? Are you asking about to define a name for a cell using Name manager ?
    You can use Hyperlink's Text or Screen Tip to show some texts on a cell.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey
    +919810929744
    dilipandey@gmail.com

  3. #3
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,285

    Re: Label cells with text which disappears on mouse click

    Hi platzhirsch and welcome to the forum,

    I've written some code that if you double click on a cell it will change the font color and make it look like the text has disappeared. the code is:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("A1:C4")) Is Nothing Then
        If Selection.Font.ThemeColor = xlThemeColorLight1 Then
            With Selection.Font
                .ThemeColor = xlThemeColorDark1
                .TintAndShade = 0
            End With
        Else
            With Selection.Font
                .ThemeColor = xlThemeColorLight1
                .TintAndShade = 0
            End With
        End If
    End If
    Cancel = True
    End Sub
    See attached for the example file.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  4. #4
    Registered User
    Join Date
    01-26-2012
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Label cells with text which disappears on mouse click

    I am not certain, whether I asked my problem probably. With Hyperlinks I cannot insert two values in the same cell, when I follow the hyperlink simply the linked cell is activated. The second solution seems a little bit over-engineered, I thought there is a built in function for this:

    Actually I want to put numbers in the cells of my sheet on which I do some calculations. I don't need to see those numbers all the time, so it would be nice to put a text on them. Normally you should only see the text, when you click on such a cell, the text is replaced with the number. This way you can "look inside" and see what its actually value is.

    Is it clearer now? I would be really glad

  5. #5
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,285

    Re: Label cells with text which disappears on mouse click

    Hi,
    I guess I really missed the question on this one. I am clueless on what this quesiton is now. I guess we need to see a sample workbook to see where you are going with this question. You can attach a sample file by clicking on "Go Advanced" below the message area and then on the Paper Clip Icon above the advanced message area.

    Sorry that I didn't even come close to what you were really asking.
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  6. #6
    Registered User
    Join Date
    01-26-2012
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Label cells with text which disappears on mouse click

    No problem, I guess I just didn't asked it probably

    I attached a sample document: groups.xlsx

    Do you see the numbers in A2, B2, C2? A simple sum function is applied on them. In order to make the document more clear, I would like to let the numbers disappear and I am pretty that I saw how my lecturer at university embedded the numbers right into the cells above:

    A1 has the value Group 1 and 51
    B1 has the value Group 2 and 9
    C1 has the value Group 3 and 28

    The default value to be shown should be Group 1 and 3, but when you click on the cells or are going to edit them, the Group 1 - 3 text should be replaced with the embedded numbers, so you can see what numbers they represent. When you leave the cell the text should appear again. You can see it in the pictures I've attached. The first one is the default view and the second one is when you click into it. When you are done with editing, the first picture is shown again.

    default-view.jpg
    edit-view.jpg

    I quiet sure that this must be possible, I just don't know how.

  7. #7
    Registered User
    Join Date
    01-26-2012
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Label cells with text which disappears on mouse click

    Found it! I format the cell with a predefined formatting rule, the rule is the text I want it to overlay and tada.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0