+ Reply to Thread
Results 1 to 4 of 4

Crate email from Excel - Pull data from excel and Create email message

  1. #1
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Crate email from Excel - Pull data from excel and Create email message

    Hi,
    I have 2 sheets 1st (Data) and 2nd is (Name and email id)

    1 Filter data in column G.(Filter Criteria is Begins with "Sent on" and "Resolved"). (In this cases there will be 35 filtered rows.)
    2 Open a email message
    3 Then Copy data from A to E and paste in email body. (In this case cell number from A1 to E58.)
    4 There should be a proper serial number in column A

    5 Again in same filtered rows filter one more criteria that is in column F. in Column F filter "Yes".
    6 Then Copy data from A to E and paste in email body below the above data. (In this case cell number from A1 to E58.)
    7 There should be a proper serial number in column A
    8 Pull email id 's from column C of Sheet (Name and email id), from to, cc and BCC columns
    9 Paste Kind attention names in email body copying from column F of Sheet (Name and email id)


    I wanted to repeat the same for all companies mentioned from cell no. G1 to AJ1 mentioned in the sheet (Data)
    Means I want to create 30 individual emails as per above filter data based on company.

    I have attached excel file and example email message.
    Attached Files Attached Files
    Last edited by saravanan1981; 09-18-2016 at 07:41 AM.

  2. #2
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: Crate email from Excel - Pull data from excel and Create email message

    I am trying to change the below code. but it not working

    Sub Send_Email()

    Dim EmailSubject As String
    Dim SendTo As String
    Dim EmailBody As String
    Dim ccTo As String

    EmailSubject = "Test"
    SendTo = "[email protected]"


    FirstRow = 1
    LastRow = 5
    FirstCol = 1
    LastCol = 2

    For r = FirstRow To LastRow
    For c = FirstCol To LastCol

    For Each cell In Cells(r, c)
    strtable = strtable & " " & cell.Value
    Next
    Next
    strtable = strtable & vbNewLine
    Next

    EmailBody = "Hi" & vbLf & vbLf & " body of message you want to add" & vbLf & vbLf & strtable & vbNewLine

    Set App = CreateObject("Outlook.Application")
    Set Itm = App.CreateItem(0)
    With Itm
    .Subject = EmailSubject
    .To = SendTo
    .CC = ccTo
    .Body = EmailBody
    .Display
    '.Send
    End With
    Set App = Nothing
    Set Itm = Nothing
    End Sub

  3. #3
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: Crate email from Excel - Pull data from excel and Create email message

    Dear Friends,
    Somehow I managed to complete my code upto 90%. I just need your help on few things.

    In continuation with my existing code in attachment

    I want code to filter the excel data further one more criteria in Sheet(Data), Range F1 and Criteria is “Yes”

    Copy a range Sheet(Data), Range A1:F58 and paste below strbody1

    Please help
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Crate email from Excel - Pull data from excel and Create email message

    Hi saravanan1981

    Try this Code in the attached (the RangeToHTML Code is also in the Workbook)...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA to send email using data from the EXCEL including email address, subject and body text
    By ec4excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2016, 11:07 AM
  2. email data from excel or create a word document
    By terence17 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-14-2015, 12:32 PM
  3. From Excel VBA, can I FORWARD an outlouk email? (not create a NEW email)
    By Marijke in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2015, 07:14 AM
  4. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  5. Copy data from excel to Outlook new email and create draft.
    By G.Bregvadze in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-08-2013, 03:31 AM
  6. How to parse data in Outlook email using HTML version of email back to excel
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-31-2012, 02:54 PM
  7. Send data from Excel in email from specific email account
    By eriknokc in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-05-2007, 05:02 PM

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