Often times you’ll find yourself working on a file in Excel that needs to be sent to a co-worker as an attachment. If you store your files on a shared network drive, it could take a little while to find your file, even if you know exactly where it is located. Even then, you may have to worry about attaching the wrong file if there are several saved with similar file names.
By using the macro below, you’ll be able to attach the file you have open to an email with the click of a button.
Copy all the code below. Paste it into your PERSONAL.XLS workbook’s Visual Basic editor, under a Module. The following steps also need to be completed to use this macro:
- Change “[email protected]” to the email address of the person you want to send your file to
- The line “This Email was sent on ” & Format(Date, “mmmm dd, yyyy”) is the subject line. Change it to whatever you would like your subject to say. This one would read “This Email was sent on March 04, 2009” assuming today was March 04, 2009.
Need help? Use our nifty guide to help figure out how to install and use your macros.