I need to add a tooltip (mouser over a cell) in a Google spreadsheet.
I want the tooltip text to be taken from another cell, some idea?
Thanks in advance!
You can use the formula =HYPERLINK(<cell>,IMAGE(<cell>)) to both create an image preview and a link at the same time. Once the formula has been applied, simply select the cell you want to preview and hover over the link pop-up that appears. The full image should appear in a floating pop-up.
Tooltips are the little boxes that pop up when you hover over something. (Hovercards are more general, and can appear anywhere on the screen; tooltips are always attached to something, like a dot on a scatter chart, or a bar on a bar chart.)
Consider using notes - they appear when you hover mouse over cells in a spreadsheet. You can add notes manually by clicking the right mouse button on a cell and selecting 'insert note'. This can also be done programmatically.
Say, you've got 2 adjacent cells. We'll use text from the second cell to add a note to the first one.
You can create the note with the text from the second cell using the following code.
function addNote() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var targetCell = sheet.getRange("A1");
var sourceCell = sheet.getRange("B1");
var noteText = sourceCell.getValue();
targetCell.setNote(noteText);
}
Here's the end result after executing the function
You can modify the code to make it run only when the sheet is edited and dynamically update the note when the text in the source cell changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With