Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Emailing

0

I have managed to set up an email button using a macro button but I need to send certain sheets within my workbook to certain people and I need to have gather certain information within those worksheets to to send also can you please help me

Answer
Discuss

Answers

0

You could do something like this:

Worksheets("Sheet name").Copy
Set wbToSend = ActiveWorkbook
wbToSend.SaveAs "C:\my file.xlsx"
wbToSend.SendMail("Email")
Kill "C:\my file.xlsx"

I did not test this by the way, just wrote it out, so there might be errors with it.

You will have to do this for every worksheet you want to send.

This will create a new file with your worksheet, save the new file, email it, then delete the new file.

This should get you started. You will need to put it in a loop to send multiple worksheets to different people.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login