Send Emails from Excel - Automatically and Manually (Macro & Non-Macro Solution)
Вставка
- Опубліковано 14 жов 2024
- VBA/Macros Course (40% Discount): www.teachexcel...
Send Emails from Excel Course (All You Need to Know): www.teachexcel...
Excel File: www.teachexcel...
Excel Forum: www.teachexcel...
How to send Emails from Excel using automation and also via a handy button-click.
This tutorial covers everything you need to know to be able to write simple working macros to send emails from within Microsoft Excel and also a simple non-macro method.
You'll learn how to automate:
adding multiple recipients
sending attachments
sending the current workbook
changing the email body and subject
adding CC (Carbon Copy) recipients
adding BCC (Blind Carbon Copy) recipients
and more
I also cover a common method that is used to create email macros for Excel, but that is not good practice, explain why it is not good practice, and show you how to change it to make it work better.
Enjoy!
TeachExcel.com
Downloadable File + Advanced Email Topics Covered Here: www.teachexcel.com/premium-courses/96/send-emails-from-excel-course?src=youtube_v_bxsvO6_uJUs_comment
(This is a premium course.)
Hello! The code is not available, is that right? We have to purchase the course?
Your first 17 seconds showed what i was looking for - many thanks mate
Excel file is not downloading i need code to practice please send me the files if possible
Outstanding! I feel like a pro with this easy to understand tutorial. Thanks!
This is what i were looking for since 2 months. Thank you Creater. Great job 👍
Your first 17 seconds showed what i was looking for - many thanks mate
So we’ll done. Having all these examples is excellent.
SUPER explication, SUPER easy to understand 👏🏻👏🏻👏🏻👏🏻
I really loved this video. I believe it's very helpful. Do you also have another video for creating an email with tables on the body? I generally prefer adding the tables on the email to be easy for my customers to see the table on the email without opening any attachment.
Thanks
Hello bro, same here. I also have to add tables for daily orders in my mail. Did you figure it out how to add? If yes, please let me know
@@shubhamgond11 Yes, you can add only selective content from the sheet instead of sharing the complete sheet
This is awesome, could you suggest how to do this using gmail as the email platform please?
Configure your Gmail on Outlook and then you are good to go
Brilliant video. I swear I have learnt more from Google and UA-cam than school ever taught me :)
I seriously LOVE you for making this video. This is going to save me countless hours at work. Cheers!
Nice work,
Could you please tell me, how to add time condition to send auto email at a certain time.
Waiting for valuable response.
Regards
Same here
What was working for me was setting scheduled notification in Outlook which triggered sending email.
Or you can set Windows schedule item which triggers excel sheet with VBA executed while open.
This was VERY helpful!
I wrote code that referenced and it worked for months until the Team expanded and i wasn't sure why only 2 or 3 people couldn't use my buttons. lol
Awesome. Very well explained. Thank you !!
Thanks RS, I'm glad you think so :)
Hi Sir,
Do you know how to send automatic mails on certain times while computer is off ?
Thank you so much for this. I have to add a section of my sheet (not an actual table). So I coded for my greetings, a short paragraph and now I need my data on the body. Can you help me do that? The tutorials using "references" show this but I get your point that this is not the best way of coding.
Very helpful especially if no exp or knowledge of vba at all. May I ask how can I attach multiple PDF files to a single email item saved in a folder?
Hey man this is one of the cool video I ve ever seen.. Thanks for this
This is great can you advise if I can code in the from email address?
Awesome vid ! Is it possible to apply a timer to the Emails ? Say every 7 months for exemple it sends an Email. What would be the formula ?
Thanks for easy explanation :)
However you can, and sometimes you have to use both .display and .send. Especially when you want to delete the default signature that adds itself to new emails.
I'm not getting the default signature. How can one add it?
Excellent tutorial!
most comprehensive tutorial so far👍🏻👍🏻👍🏻
Great Tutorial. Question how can I now send the email to include a table?
Great job! Appreciate the extra warnings/recommendations to NOT use code that has to enable References. Good idea to avoid issues when sharing or application version upgrades. :) Would like to know if I can use the "emailItem.Attachments.Add ("C:\test\test.xlsx")" with the file reference of something like ("C:\test\*.pdf") that would allow the user to be prompted to choose a PDF file in the C:\test folder, because I already have working code prior to this statement that printed the active workbook to PDF and already saved the workbook as XLSX for future editing.
Great video. Quick question, for the email body, what do I put in here so that email goes down the page and sentences on new lines? I'm writing my email but when I press play it's all coming out on one line. Thanks.
%OA is equiv of carriage return/ new line, insert in your text, spaces not required before or after so "have a nice day%OATim" puts on two lines
thank you so much!
Please, how to send email to different recipients with different attachements?
Simply brilliant. Super easy to understand.
Great Work! I would like to learn more. Please keep me posted
Thank you! :) Subscribe to the weekly newsletter on TeachExcel.com and you will be always informed, including for the new classes I am making)
Hi.. great video.. you really broke it down into easy steps.. thanks! Just so I understand.. the main benefit of referencing the Object Library of the external application (in this case.. MS Outlook) is to get Intellisense when writing your code.. correct? But, the downside is that if the code is run on a system without the Object Library being enabled, then the macro fails.. thus making your first method more robust.. but with the slight detriment of not having access to Intellisense while you write your code.. correct? Thanks again for all the great tutorials.. learning a lot. Thumbs up!
This was very helpful. But may i ask how can i add cc using another cell on the excel
Thank you very much for the valuable information. I have question, Hwo can I send the email from different mailbox?
Outstanding. Never used VBA before. i just try to keep all the code making in the cells. With that in mind how do i take what you made in this video and say have it automatically generate (in display version as you stated in your code) when a cell triggers it... Example: i keep a workbook record of daily equipment status. if a cell reaches under say 80% the cell will trigger the auto email and display it... how do we get to that point.
This is an awesome tutorial! Love it.
I am working with tables. How can pick values from cells in the row and place them in the body of the email? Any feedback greatly appreciated!
Here's another way to do this without any VBA and only using a few formulas!
ua-cam.com/video/WBHKxZUYn34/v-deo.html
Refer to Leila gharani’s video where she talks about this
Hi! You are a great tracher! Please let me know...Can i choose to sent only one sheet and not the entire workbook?
Fantastic - just what i needed. Thanks!
Hi thanks for the video, very useful for me. However, is it possible to just attach a single worksheet from the workbook?
thanks a lot, great video, any suggestions about choosing a different sender with outlook? and adding a different signature?
Great Video! Thank you so much for sharing.
great video, very helpful and easy to follow. How would I go about adding the default signature 2 lines down from the contents of the body?
You can create (Regards and Name )the signature on the mail body while writing the code or you can use the signature as a reference also.
Very nice and clear explanation. Awesome tutorial.
Thank you! I'm glad you liked it!)
I looked for a VBA methodology for sending an email to a list of people in an Excel Spreeadsheet. The problem with many of the proposed solutions is that you have asked someone how to tell what time it is and they showed you how to build a clock. You provided a relatively simple framework that I was able to modify so that it looks at a list of names and emails and sends a message to each person on the list. The only thing I had to figure out was how to reset the email after each email was sent as I was getting an error message as I looped through my email list. With a little bumbling I stumbled on a solution using createitem(0) at the end of each run through the loop. Thanks.
Can you send the code for this.
@@petersonmcdavid5520
The code below sends a PDF that is generated in another macro to a list of recipients.
The list is generated from a form with a dropdown box that allows you to select multiple recipients. That dropdown box is on a master form and the names and emails are stored on a separate Worksheet within the workbook. Once the names are selected the macro I provided below is executed. It runs through a loop For/Next and for each name selected it executes the send routine imbedded in this code.
I admit this is not as clean as it could be but it worked for my purposes. I just tested it and it still works.
Hope this helps.
Kevin
Private Sub Email_PDF_Click()
Dim emailapplication As Object
Dim emailitem As Object
Dim membername As String
Dim membmail As Variant
Dim ML As Worksheet
Dim count As Integer
Dim i1 As Integer
Dim NoEmailCount As Integer
Dim printnoemail As String
Dim DS As Worksheet
Dim listcounter As Integer
Dim meetingname As String
Dim i As Integer
Dim group_name As Integer
Dim PDF_Email_File As String
Set emailapplication = CreateObject("Outlook.Application")
Set emailitem = emailapplication.CreateItem(0)
Set ML = Worksheets("Member List")
Set DS = Worksheets("Data Sheet")
count = WorksheetFunction.CountA(ML.Range("A:A")) - 1
meetingname = DS.Range("G2")
Module2.Create_List_PDF
NoEmailCount = 2
PDF_Email_File = ActiveWorkbook.Path & "\" & meetingname & " Membership List.pdf"
listcounter = Edit_List.Listcount
For i = 0 To listcounter - 1
If Edit_List.Selected(i) = True Then
membername = Edit_List.List(i, 0)
membmail = Edit_List.List(i, 1)
If membmail = "" Then
GoTo errorloop
End If
emailitem.To = membmail
emailitem.Subject = meetingname & " Meeting Lottery"
emailitem.Body = membername & ", the latest version of the " & meetingname & " Member Phone List is attached."
emailitem.Attachments.Add PDF_Email_File
emailitem.send
Set emailitem = emailapplication.CreateItem(0)
errorloop:
End If
Next i
Set emailitem = Nothing
Set emailapplication = Nothing
Worksheets("Front").Select
Range("a1").Select
For i = 0 To Edit_List.Listcount - 1
Edit_List.Selected(i) = False
Next i
End Sub
@@kevinklarnet8115 I love it are you currently on LinkedIn?
@@petersonmcdavid5520 Glad it helped. Took some time to cobble it together a while ago. There may be a couple of unnecessay lines of code there. Yes, I am on LinkedIn.
Hi, thanks for this informative video. But could you please tell us how to add signature in it?
Hi Buddy good video, i will to send a sheet by email not complete file is there option in Excel
This is awesome. Exactly what I was looking for.
very very nice and important tutorial
Thank you so much!!!! I was struggling it was easy to follow and to understand the content.... But I have a quick question though, If I add a range of cells that contains a table and I add it as the email body will the email keep the table's formatting, like color, size and/or font?
Yes
This was a great tutorial! I had a quick question though. I do account management type work and have different internal associates attached to different clients on a sheet. Sometimes I have to send 100 emails to 100 different people while including 2 or 3 different people attached to each email for different clients.
If I have a spreadsheet where lets say the client's email address is in A1, the manager for one product is in b1 and another product c1 (and then that pattern continues through A100, B100 and C100); how would I code it so that 100 people get 100 different emails while having the the correct team members CC'd for each.
Additionally, is there a way for me to include form codes in the email body. For example, personalizing the name, dates, business names, ETC for each of the emails being sent out?
I love it great job!!!!!!!!!!!!
Great !!! Is there a similar way for recieving an emails?
You saved me so much effort. Thanks for this amazing video.
I'm very glad I could help :)
Hi Dear, This is very good video but i am looking for to send auto email to different recipients based on cell value. if you any idea then please share your knowledge
When you set this macro to issue an email automatically, when does this send? Everytime Excel is opened? Beginning of the day, every day?
Well put together video, when i run it keeps staing waiting for object to run and will not complete.
Great videos. I saw security alert 'allow', 'deny' when setting are on '. Send' when doing bulk emails from Excel to outlook. Is they way to diaable it especially when doing bulk emails
I am a complete macros virgin and I managed to get this to work - thank you so much!!
You are very welcome! I'm glad I could help))
Haha. He took your virginity.
It's a very helpful one.Thanks for sharing.
is it possible to send a selection of the workbook as a pdf and not the entire workbook?
Awesome ..thanks
Thanks a lot for all the codes. Very useful.
Hi,
I have query, if there are multiple sheets in the same excel file and I just want to send sheet1 only.
Is that possible??
If yes, than how??
Thanks
Please answer to this question!!! Still waiting
I have the same doubt
Thank you so much. It helps me alot.
Really helpful tutorial and awesome presentation. Very nice work.
Loved this
I have an address book on sheet two.
Is there a way to have VBA copy line 1 email address onto the "To" box and move on to line 2 once complete?
I have 40 vendors, my email is a standard email but I need a VBA that can copy the address info from Vendor 1 then move to Vendor 2. Please help, thank you love your videos.
This is pretty much What I was looking for- Now Is there a way to autorun this process at 7am every morning?
If you have Excel open at 7am every morning, sure. Otherwise, not from vba in Excel - I won't see a notification for your reply by the way, so if you have further questions on this, ask in the forum on TeachExcel.com - but usually we instruct people to use something outside of Excel if it is a must-do task every day at a certain time.
How to add applications to fetch data? For example the macro should connect with IBM Reflection application to fetch the data
Thank you, great video! Do you have a video for this? I have a workbook with 70 sheets, one sheet for one person. Through VBA and without breaking up the workbook into 70 separate workbooks, can I email a single sheet to each person if their email address is provided in a cell on their specific sheet?
No, but you can create code that does all of that in the background - creating the workbook, sending it to the user, and deleting it - for each user. If you want help figuring this out, post your question in our forum and provide a detailed description of the issue and any code that you are already working with. The solution to your issue is not complex, but it requires a few lines of code for sure.
The forum: www.teachexcel.com/talk/microsoft-office?src=yt_comment
Hi, thank you for this wonderful video. I Just want to ask the code to add auto signature. thank you
Thank you
Hi, how would you go about adding a 'Check Names' object in VBA?
Is there a way to add code that saves the workbook before it sends without hitting the save button on the ribbon? Trying to remove steps if I can to make it easier on the people that will use my worksheet. Thank you
Awesome video for excel learner.
This is a brilliant video! With this ‘create email function’ I am looking to create a timetable of sorts and input colleague names. I’d like excel to then email each inputted colleague with a calendar invite (outlook) for the specified date and time. Is this possible??
Thank you so much! Nice explanation. I figuered out how to loop for several mail recipients.
How did you do that? I have an excel file with 2K email addresses that I need to send out with an attachment.
rock.michaelc@gmail.com
This video has been fantasic -- one thing that I'm having trouble figuring out -- if i wanted my "Range" to include several email addresses...so, for example A1:A5 -- each new row is a different email address...how might i go about that?
Let me know if you know a solution.
Thanks you very much for a very well explained and easy to understand video
I have two questions: 1) Is there a way to add a larger Body to the email (several lines)? and 2) How can you add a "larger distribution list"?.
Again, thanks a lot.
Leopoldo Vazquez
Is there a way to specify the email address you want to send the email from?
Good night, it is possible to create a spreadsheet, with due date, description, value and payment status and place it on OneDrive or elsewhere but it will automatically send an email with the accounts that have Status = Open and that are due the day before expiration.
All this without having to open the spreadsheet? If possible, I could teach. Thank you very much.
Hi, love your work. You make methods like these easy to understand!!!
I'm so happy to hear this :))
Thanks for the video. What if you want to add a business signature?
You can create (Regards and Name )the signature on the mail body while writing the code or you can use the signature as a reference also.
Is there a walkaround to not use outlook? or at least not outlook desktop?
Is it possible to send just a worksheet instead of the entire workbook?
Great job👍
Hi, Can we use the Mail app instead of outlook in VBA?
The Mail app is pre-installed on all versions of windows 10.
A quick question...Is there a rule in the macro that will send the email as a "Send on Behalf of" and a "Send As"?
is it possible to make a macro to send email but through gmail in chrome or else?
Hi.. If I automate the send thru if condition and the file will be used or openned by 2 users (shared file), will this send two emails one each from two users who currently open the file at the same time?
If I have to extract data from online application instead of excel can I do it if yes pls guide me
Thank you very helpful, How can I send only the Active sheet with the Active sheet name vs "Book 1".
Hi Michael, first, save the file before sending it and then you can control its name.
Hi Teach,
Is there a way to automate the process even further and have the email sent on a specific Day and time, and have this repeated every year?
I am also looking for the same
I would like that as well
Same
Afternoon bud, I did exactly what you did on the video, when I update my spreadsheet no email gets sent out. Do I need to click on a button to activate it, or.....? your help would be very much appreciated.
You have to physically click send to forward it to recipients. I'm searching to see if what you want can be achieved.
I would like to send via email only the active sheet not the entire excel file. How can i do it?
great video! thanks
Brilliant Video, you explain things so easily. Would it be possible to auto-fill the email address based on value of a cell? Also auto-fill their name from a cell in the email body?
Thank you
Basically, you can do anything you want with the macro, but I do not have a video or tutorial specific to your need. Check some VBA/Macro tutorials that mention looking up data and using IF statements to check the data and using the FIND method in vba and combine that with, probably, using a placeholder in the body of the email that you use to replace with the name - if you keep the email body in the VBA code in Excel.
I want to copy the excel range to send an email respect to the current date.
Example:
The table range is A1:D20
Column A for Date.
Now I want to copy the range A5:D9 to send an email body, A5 to A9 cell value are current date.
ua-cam.com/video/tUZZDTb67uY/v-deo.html
How do I include an attachment where the pathway comes from one of the cells in the Excel Workbook?
please where do i copy the macro...thanks you very much
What if I wanted to email an entire row of data, how to I create and email that array?
Did you get the solution bro?
Sir, is that possible I copy some ranges and paste in excel like table etc.. Please consider for replying. Thank you so much
Hi, U got the answer how to do it?
@@limjoan5619 Still No
Do you have a macro code for sending email from Excel to IBM Notes instead?