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