Home > Net >  Insert text to selected range with button
Insert text to selected range with button

Time:09-22

I apologize in advance for having little to no knowledge on this matter. I am familiar enough to utilize VBA but have recently made the switch to Sheets and I am lost.

I was originally looking for a way to prompt a drop down menu when double clicking a cell in a range that will then add the selected information as a prefix to the text.

Example: cell contains "First Last", upon double clicking you get a drop down to select "Mr., Mrs." when selecting "Mr." the cell now says "Mr. First Last" but it doesn't appear that you can set a double click event.

So now I am trying to come up with another solution where you select desired cells and 'apply' the function.

Example: Select cells A1 B1 C3 D9, click a button that applies "Mr. " as a prefix. Selecting it again will remove it.

Please help me get this moving.

CodePudding user response:

Try this:

// menu

function onOpen() {
  SpreadsheetApp.getUi().createMenu('⚡ Scripts')
  .addItem('           
  • Related