+ Reply to Thread
Results 1 to 4 of 4

Generating mail messages with a Macro

  1. #1
    Registered User
    Join Date
    05-17-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Generating mail messages with a Macro

    Hi all,

    I have a macro that works but I need it to do one more thing and I cant figure it out: the macro generates emails and attaches worksheets to it, it also adds a subject in the email AND I need all the emails to have a generic message in the body of the email, How do I do that?

    Thank you

    Sub Mail_every_Worksheet()
    Dim sh As Worksheet
    Application.ScreenUpdating = False
    For Each sh In ThisWorkbook.Worksheets
    If sh.Range("b5").Value Like "*@*" Then
    sh.Copy
    ActiveWorkbook.SaveAs sh.Name & " _ " _
    & ThisWorkbook.Name & ".xls"
    ActiveWorkbook.SendMail ActiveSheet.Range("b5").Value, _
    "Year to Date Chargeability as of May 25, 2013"
    ActiveWorkbook.ChangeFileAccess xlReadOnly
    Kill ActiveWorkbook.FullName
    ActiveWorkbook.Close False
    End If
    Next sh
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Generating mail messages with a Macro

    Did you try
    HTML Code: 

  3. #3
    Registered User
    Join Date
    05-17-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Generating mail messages with a Macro

    I want a macro that does it for me. Thx though

  4. #4
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Generating mail messages with a Macro

    If you had gone to the site you could have got multiple options or flexibility of macros readily available for that.
    Best Regards/VKS

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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