Email Individual Worksheets to Multiple Recipients

  • Hello.

    I'm SUPER new to VBA, so I have no idea what I'm doing, but DO know what I need to do.

    I have a report that includes all the checks that our payroll company processes each week (lists name, address, check number, department in different columns). I have a code to separate this master list into separate worksheets based on department code. (Everyone with department code 012 will be sorted into a sheet named 012)

    I have the following code that sends those separate worksheets to a group of individuals (who are listed on a different worksheet A1: Worksheet name, B1: Email Address (Subsequent email addresses are listed under B1 in B2 and so on), C1: Email Subject...then the list continues in D1, E1, and F1).

    The problem I'm running into is the code won't run completely through the list if it encounters a worksheet name that doesn't exist.

    For instance. The site that is listed as 016 (therefore gets named worksheet 016) didn't work that week, so no one received a check. There is no worksheet 016 created so the code stops emailing through the rest of the list.

    ALSO....Is there a way for me to include a column where I can put info in the body of the email?


    My questions are:

    1) How do I get the code to continue if it encounters a worksheet that doesn't exist?

    2) Can I include text meant for the body of the email?

    Here is the code I'm working with.

  • Re: Email Individual Worksheets to Multiple Recipients

    Not tested....

    If I've been helpful, let me know. If I haven't, let me know that too. 

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!