+ Reply to Thread
Results 1 to 9 of 9

Text box which appears on mouseover of a cell and contains dynamic text from another cell

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    13

    Text box which appears on mouseover of a cell and contains dynamic text from another cell

    Hi,

    I am extremely new to this. I have reasonable excel skills. I need to create a text box which appears when you hover over a cell.

    I would like this text box to contain text contents from another cell on a different worksheet.

    Is this possible with VBA?

    Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    Hi -

    Welcome to the forum.

    Why not use the excel comment instead?

    event

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    Not sure if "hovering" is possible to implement, but if clicking (selecting) the cell is fine, it's possible. This uses data validation input message.

    If put behind a worksheet's code, selecting a cell in Column D will display value of cell H3 as data validation input message.
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  4. #4
    Registered User
    Join Date
    01-15-2014
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    Hi,

    Thanks for such quick responses.

    Can comments in excel be set to display the contents of a cell? I wasn't sure if it could be done?

    I am trying to show the numbers of low/medium/high change as a number but when you click or hover on cell it returns further detail of change name which I have calculated on another worksheet?

  5. #5
    Registered User
    Join Date
    01-15-2014
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    Wow, thanks Millz.

    This works, but I now need to see if I can get it to select a specific cell (B7) and this will display value of cell in a different worksheet 'JanChangeNames!B2' as data validation input message?

    Can this be done or does the cell have to be in the same sheet?

    Thank you,

    Nic.

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    You can try:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-15-2014
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    I am getting a runtime error (9). Subscript out of range.

    It highlights:

    .InputMessage = Sheets("JanChangeNames").Range("B2").Value


    I have attched the spreadsheet to see if that helps, sorry I am really struggling with this, really new to VBA and find it so confusing.
    It is basically cell B7 in the sheet called Change Calendar that I want to have the input message and sheet called Jan Change Names cell B2 to be the details it returns.


    View of Change Spreadsheet 14 v2.xlsm

  8. #8
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    Ok so there were 2 problems. Sheet name was wrong, it should be 'Jan Change Names'. There were no spaces in the code because that's what you shown to me in post #5

    The next problem is, the cell B2 in Jan Change Names was result of a longgg concatenation. And in your formula it has many spaces included as well (in the concatenation). Data validation input message has a maximum length limit of 254 characters. If your cell B2 ends up being longer than 254 characters, this will give you an error.

    We can, however, avoid the error by first trimming the cell value (this removes redundant spaces), and then take the first 254 characters only.

    Please Login or Register  to view this content.
    You can also change it to this if you want it to be displayed as the first 251 characters and followed by "..." if it is longer than 254 characters
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-15-2014
    Location
    Glasgow
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Text box which appears on mouseover of a cell and contains dynamic text from another c

    You are amazing!

    Thank you so much this has really helped me.

    Loving the Excel Forum.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to take cell with custom format and assign to variable as text (as appears in cell)
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-07-2014, 02:44 PM
  2. Replies: 1
    Last Post: 12-10-2013, 05:23 PM
  3. Replies: 0
    Last Post: 11-16-2012, 11:42 AM
  4. [SOLVED] search a text cell CONTAINING matching text in a dynamic range (not exact match)
    By msgoldcup@gmail.com in forum Excel General
    Replies: 4
    Last Post: 04-02-2012, 07:37 AM
  5. text appears in formula bar but not in cell
    By lsparks in forum Excel General
    Replies: 8
    Last Post: 12-05-2008, 06:55 PM

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.6.0 RC 1