function shareActive() {
  var ss = SpreadsheetApp.getActive();
  var sheet = ss.getActiveSheet();

  var newSheet = SpreadsheetApp.create("New Sheet");
  var id = newSheet.getId();
  var open = SpreadsheetApp.openById(id);
  var copy = sheet.copyTo(open);

  var ui = SpreadsheetApp.getUi();
  var user = ui.prompt('Enter user email address', ui.ButtonSet.OK_CANCEL);

  if (
    user.getSelectedButton() == ui.Button.OK
  ) {
  var email = user.getResponseText()


function onOpen(e) {
      .createMenu("Share Sheet")
      .addItem('Active Sheet', 'shareActive')
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter