In this VBA quick Tip we are looking at emailing from excel again but this time we are going to be looking at how to send a range from excel. The code below is the code you will need to copy so that you can do this. It is a lot different from the old code but some parts of it are the same. The first part of the code is selecting what range to send I have it set to A1:E20 and under that you will see an error message we have made just in case the range is wrong.
The next couple of parts of code all to do with creating the document that will be sent.
It saves the workbook with a time and date stamp in the title after it has been sent, it will be deleted from your hard disk. If you would like to stop this look for the line of code being in with kill and remove it.
The last part of the code is part which is actually going to send the email. This part is very similar to my other blog post about emailing with VBA. Here is where you choose you want it sent to and if you want anyone copied in. That’s all the code you will need to send a range of a spreadsheet to someone in an email.