Results 1 to 2 of 2

With AutoFilter - copy email address in active cell & paste in To field of Outlook email

Threaded View

  1. #1
    Registered User
    Join Date
    11-05-2015
    Location
    San Antonio, Texas
    MS-Off Ver
    2010
    Posts
    1

    Smile With AutoFilter - copy email address in active cell & paste in To field of Outlook email

    Hi y'all, I'm new to the forum and need help with what seemingly should be an easy problem but hasn't been.
    Here is the setup:
    *Row 1 has column headers (Site number, Customer name, Order number, etc.)
    *Column A contains specific site numbers
    *Columns B-S have specific elements in each column related to the site numbers (customer name, order number, etc.)
    *Column R has multiple email addresses in each cell that correspond with the site number in each row (site 123 in column A2 has 5 email recipient address in cell R2 and so on)

    Using VBA with Auto.Filter, the goal:
    *Filter each site in column A, which could have more than one order
    *Copy header row and the row(s) of customer orders and columns A:S for each filtered site
    *Paste data into an email as a table
    *Copy the email addresses in column R then paste into the "To" field in the outlook email

    I have everything else working but I'm stuck on pulling the email address out separately. The code I'm trying:

            Set oOutApp = CreateObject("Outlook.Application")
            Set oMailItem = oOutApp.CreateItem(0)
    
            With oMailItem
                .SentOnBehalfOfName = "Carmen@domain.com"
                .To = range.AutoFilter Field:=1, Criteria1:=ActiveCell.Value
                .Subject = "Action Required - Order Review"
                .BodyFormat = 2
                .Display
            End With
    I'm getting a Compile error: Expected: end of statement with "Field" highlighted...what's wrong? Any help you can provide would be greatly appreciated!

    Thanks!
    Carmen
    Last edited by alansidman; 11-05-2015 at 09:40 PM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Email Macro to attach a non active worksheet to outlook email
    By mickgibbons1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-21-2013, 08:38 PM
  2. [SOLVED] Macro: Get Email Address from CC field (Outllok email msg)
    By rampal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2013, 06:44 PM
  3. Replies: 0
    Last Post: 02-21-2013, 04:46 AM
  4. Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell
    By paul_sykes00 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-17-2012, 12:54 AM
  5. Replies: 1
    Last Post: 03-08-2012, 01:57 PM
  6. Extract email address and copy into .To field
    By eckert1961 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-10-2009, 11:39 AM
  7. [SOLVED] can I copy a column of email addresses, paste into email address?
    By Lizizfree in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 07-20-2006, 05:05 PM

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