Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2007
    Location
    Butler, Pennsylvania, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    macro to email a pivot table (MS Excel 2003)

    I have a macro that I run to format a pivot table to remove any ability of the receiver to view anything other than what I send. I want to be able to automate the sending of this pivot table to the selected salesrep via Microsoft outlook 2003. I do not have the email address within the pivot table but it should be able to be populated within outlook using the same salesrep field, [I attached a shell of what the pivot table looks likes]. I have to run the macro individually for each salesrep that appears in the table for that day and then send it. I would like the email subject line to read Daily Order report and insert the date from the pivot table, I would want the email To: populated with the sales rep name from the pivot table and then for the pivot table copy to be attached to the email.

    I work on a Maxspeed terminal
    Using MIcrosoft office 2003 and Microsoft outlook 2003

    I hope I have given enough info in an understandable format.

    Please help.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: macro to email a pivot table (MS Excel 2003)

    Welcome to Woody's Lounge!

    The following macro will send the active workbook (containing the pivot table) to the e-mail address listed in cell B1, with the subject containing "Daily Order Report " followed by the date listed in cell B2.
    <code>
    Sub SendPivot()
    ActiveWorkbook.SendMail Recipients:=Range("B1"), _
    Subject:="Daily Order Report " & Format(Range("B2"), "mmmm d, yyyy")
    End Sub
    </code>
    You can change the date format the way you want.

  3. #3
    New Lounger
    Join Date
    May 2007
    Location
    Butler, Pennsylvania, USA
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macro to email a pivot table (MS Excel 2003)

    Thanks, this is awesome

Posting Permissions

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