+ Reply to Thread
Results 1 to 6 of 6

Emailing Multiple Worksheets using VBA

  1. #1
    Registered User
    Join Date
    02-12-2012
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    6

    Emailing Multiple Worksheets using VBA

    I'm trying to email multiple worksheets to multiple recipients contained in a column on a sheet named "Directory". The email address is contained on the 7th column of the sheet.

    I've written this code using several pieces of code from different sources. It only emails the first sheet if finds and then it gives me an error when it goes back through the loop. The error occurs on the code-line: "With WBA.Sheets(AAO).MailEnvelope". The error I get is a Run-time error. It says: "Method 'MailEnvelope' of object '_Worksheet' failed" I don't know what's wrong.
    Please Login or Register  to view this content.

    These are the tabs I have on the workbook:
    "Directory", "New Errors", "Producers", "AI", "BM", ...., "WS"
    I want the macro to look in the directory Column A and find the offices that have a worksheet... "AI", "BM", etc. and use the email in the directory to email only that sheet to them. This is a sample of the names on Column A. Some repeat so I want to email the sheet to both recipients. You can see below that I want to email the sheet named "AI" to both email addresses in Column 7 of the same row.
    AI
    AI
    AV
    BE
    BG
    BM
    BO
    BR
    Last edited by arthurbr; 02-27-2012 at 02:59 AM. Reason: Tags added

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Emailing Multiple Worksheets using VBA

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

  3. #3
    Registered User
    Join Date
    02-12-2012
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Emailing Multiple Worksheets using VBA

    I don't know what you mean. There is no # sign when I edit the post..... I need some guidance....

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Emailing Multiple Worksheets using VBA

    To add code tags, edit your OP-Click Go Advanced -Then after highlighting the code press the # button. I have corrected it for you.

  5. #5
    Registered User
    Join Date
    02-12-2012
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Emailing Multiple Worksheets using VBA

    Never mind.... I figured it out on my own.

  6. #6
    Forum Contributor
    Join Date
    04-03-2011
    Location
    India
    MS-Off Ver
    Excel 2015
    Posts
    122

    Re: Emailing Multiple Worksheets using VBA

    Hi edwinjaxfld

    pls share the the code on how it works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1