To use this script in Google Drive:
- In your spreadsheet, click Tools->Script Editor.
- Paste the contents of Code.gs into the editor.
- Save.
- Select "Allow" when Google asks about permissions.
- Reload your spreadsheet.
You should now see a new file menu option, "Export".
Finally a PDF menu button. Thank You!!!
Two questions. How can I save the PDF by the name of a value in a cell. For example, a sales order number that changes. I have attached a tally code to change the number of the SO#in the cell (G5) every time the "create PDF" is pressed and I would like to save each PDF by that SO#. Which brings me to the second question. How can I set this tally code up in a different spread sheet (a data sheet) and the script reference it to change (G5). For example, G5 (sheet 1) = C1(data spreadsheet) where C1 is the tally. Here is what I am currently using.
SpreadsheetApp.getActiveSheet().getRange('G5').setValue(SpreadsheetApp.getActiveSheet().getRange('G5').getValue() + 1);