Export and Email Specific Range in Google Sheets in CSV,PDF or XLSX

Script for Exporting a specific Range from spreadsheet and save it in drive or email it in attachment in CSV, PDF or XLSX .
If you want to export just specific sheets in the spreadsheet just check this Tutorial .





How to use it :

In Spreadsheet Menu Click Tools and select Script Editor from spinner to go put your script, in Excel "Visual Basic" on developer mode.



1- Open Google Apps Script file or create new one : File > New > Script File and name it with whatever you want .

2- Past the script in the bottom of Article and Save the Script .


  • What necessary to change :
Line 5 : Range you want to export it.

Line 6: Sheet who has that range .


LINE 59 : Email Receiver, if you want to email a multiple emails just make comma between each email address e.g : 'pace3man@gmail.com ,spider-max@live.fr,......'  .

LINE 60 : replace Title word with whatever.

LINE 61 : The body of Email.

LINE 64 : The Attachment file name.


  • Finally
1-  After saving select the function name.

2- Button to run that script.

3- Run script !



The Script :



Comments

  1. How to just make a button that downloads the sheet as pdf to your computer?

    ReplyDelete
    Replies
    1. On workbook menu File > Download as > PDF

      Delete
  2. This is very cool and helpful . Is there a way to make it email automatically every Monday at 14:00?

    ReplyDelete
    Replies
    1. Yes, by using trigger option in script editor you can choose a desired time to autorun this script

      Delete
  3. What a great script!

    I wonder if I can also specify more than one range in your script?

    ReplyDelete
  4. hey! I have an issue, I am saying pdf of the file but in one page there are a lot of pages as in 4 copies of 1 invoice but the issue the when it saves the pdf it divides the invoice and make it on next page. in print there is also issue then. Please help.

    ReplyDelete
  5. This is good information and really helpful for the people who need information about this. thanks for sharing export email details.
    AngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery

    ReplyDelete
  6. Anonymous8/17/2020

    Hi,

    Thanks so much for this script!

    One question: My CSV is sending German text and the ä, ü, ö (e.g. "Radprofi stürzt über Brücke in Schlucht" are not being displayed correctly. What can I do about this?

    ReplyDelete
  7. How to download data with start and end date in csv or xlsx format?

    ReplyDelete
  8. very thanks you,is is useful!

    ReplyDelete
  9. Windows Vista Product Key 2023 is a activate key that is used for activation of windows vista ultimate, window vista home, basic window vista, home premium .Windows Vista Product Key Generator

    ReplyDelete

Post a Comment

Popular posts from this blog

Email a Custom Sheets as PDF in Attachment

Google Sheets vs MS Excel - What to choose in 2020 ?