+ Reply to Thread
Results 1 to 10 of 10

Excel vba sending email validation list

  1. #1
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    275

    Excel vba sending email validation list

    Hello Experts,

    I have one File with me. I want to create a button in sheet 1. The Column A shows list of locations. So once I select the the location from the drop down list (say I select "Searcy" as my location) to whom I want to send emails. So all the 3 rows which has the records/data for Searcy location, Excel should automatically attached this file to Outlook (there should be only 3 records to this attached file in Outlook).

    This should also contain the Subject line and the body. In my email Subject Line and body will be same for all the locations I'm sending e-mails to, only the location will be changed.

    Let me know if you still require any additional clarifications.

    Many Thanks,
    Prakash
    Attached Files Attached Files

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Excel vba sending email validation list

    Yes, Needs some clarifications.
    Where is the Subject and Body text in the Attached file..?
    and who are the recipients..?

    And

    Where is the Drop Down you are talking about..?

    However here are some links you may be interested in:-
    http://excel-buzz.blogspot.com/2015/...excel-vba.html
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  3. #3
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    275

    Re: Excel vba sending email validation list

    Dear Gautam,

    We can assume anything for the Subject line and the body text:
    For Eg: Subject : Dashboard Reports for Feb 2015

    Body : Dear All,

    Thank you for submitting Kaizen focused on improvements.

    It is really good thing that we are participating very enthusiastically to build this culture in SCMSSC.

    And about the drop down - i mean to say, it's the filter I have applied to the header to my last attachment. A1 is named as location, so once I apply filter to Searcy Plant, only that records shoudl get emailed.

  4. #4
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Excel vba sending email validation list

    Try this untested one..
    Make sure to open Outlook before running the Code.

    1. Assign the SendMailAuto Macro to a button.
    2. Filter the Range and Click Button.

    HTML Code: 
    Last edited by Vikas_Gautam; 02-27-2015 at 05:57 AM.

  5. #5
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    275

    Re: Excel vba sending email validation list

    Dear Vikas,

    I've assigned the Macros to Button. Below are the highlights when I tested this Macros:
    1. When Filtered as per my requirement and clicked on the Button, email gets delivered to the added recipient.
    2. The whole sheet gets emailed included the button and Macros.
    3. I also observed that once I hit the button to send email, the Num Lock on my keyboard gets off.

    What basically I wanted -- that when I click the button to send email, only the filtered records (say for Searcy Location) should get copied to the new workbook and should get saved if required to the given path. If there are 100 records of which there are 20 records for Searcy, so only the records of Searcy should get emailed.

    Thanks,
    Vikas

  6. #6
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Excel vba sending email validation list

    Oh Sorry,
    I misunderstood the requirements a bit.
    The Code was an untested one. I am glad that I worked without any error.
    I am revising the code. will catch you in a minute or two.

  7. #7
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Excel vba sending email validation list

    Try this one:-

    HTML Code: 
    Last edited by Vikas_Gautam; 02-27-2015 at 09:13 AM.

  8. #8
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    275

    Re: Excel vba sending email validation list

    Dear Vikas,

    It's working perfectly..... now lastly 1 question....... how do I assign this macro to a button.....
    Now I want a button on my sheet.... and once I filter my required selection and click on the button, email should get delivered to added recipients.

    Many Thanks Vikas

  9. #9
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Excel vba sending email validation list

    Insert a button from the Developer tab.
    and Right click on it
    you will find Assign Macro option.

  10. #10
    Forum Contributor
    Join Date
    02-04-2015
    Location
    India
    MS-Off Ver
    365 (2202)
    Posts
    275

    Re: Excel vba sending email validation list

    Dear Vikas,

    Wonderful............ It's working very perfectly. If anytimee u r in Pune, you owe a beer from me.

+ 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. olMail - Email Attachment Variable. Sending Email through Excel
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2014, 07:55 AM
  2. olMail - Email Attachment Variable. Sending Email through Excel
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2014, 07:41 AM
  3. sending absence list via email
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-15-2014, 02:21 AM
  4. Sending HTML email via excel VBA - arriving as RTF email
    By Shuter1 in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 04:35 AM
  5. Sending Email by Selecting Names From a List
    By modytrane in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2008, 11:50 AM

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