Bulk Outlook Emails with CC and Attachments and Priority using Excel VBA (Code included)
HTML-код
- Опубликовано: 7 фев 2025
- Welcome to my ExcelPowerTips Channel!
This video shows you the power of Excel VBA to dynamically via a loop compose and send an Outlook Email for each row of an Excel Dataset containing the required information.
It also shows you how to add the primary and multiple CC circular email addressees with multiple attachments and set the priority for each one.
This method also uses late binding where the Outlook Application object is created during runtime so you don't need to go the the VBA editor menu to select references for the Outlook Object library.
Doing it this way makes it easy to share your Excel workbook with users without issues.
If you enjoyed watching this video consider subscribing and share this amazing Excel Power Tip with others.
Download link to my Excel VBA Code right here:
drive.google.c...
Enjoy!
LIKE - SUBSCRIBE - COMMENT - SHARE - ENJOY!
Thankyou so much for the support. It worked!!!
You're welcome! happy to help.
Hi Sir,
If the email has a template that contains a table range to send in each email body, please help.
The table range is depends on Employee Name [ Column A ]
Hi, please explain further what you want the VBA macro to perform.
i use power automate (personal-free),export outlook 2016 mail to excel 2016, but there is no outlook flag selection can be use in outlook action. Its very important to manage email task progress for deportment. Can you help me how to setting? thank you.
Hi thanks for your comment however I don't know as I haven't used Power Automate before. Maybe refer to forums relating to this may help you.
Yes you should be able to attach any document file as you specify the full path in the Excel sheet for the VBA code to pick.
Thanks for watching.
Why the body email with "Please find attached ...." is unable to move to new line, it is on same line with "Hi"?
The email body text is within a single cell and in the formula bar you press ALT + ENTER to move to a new line as a formula text in the separate sheet. This cell is then referenced in the main email list sheet for distribution.
Hii sir..
I want to send excel table to outlook to more recipients... Can you help me how to create that
So my example contains Two columns in the Excel sheet in columns C and D to pick up the To and CC email address in the VBA Loop code. To include more recipients you will either need to add new columns for each recipient or add the new recipients directly in code with a new CC list like this anonymous example:
' Set email properties
With OutlookMail
.To = wSht.Range("C" & intRow).Value ' Employee main email
.CC = wSht.Range("D" & intRow).Value ' Manager Circular email
' For more than one CC separate with a semi-colon
.CC = "New_Recipeint_1@gmail.com" & ";" & _
"New_Recipeint_2@gmail.com" & ";" & _
"New_Recipeint_3@gmail.com" & ";" & _
"New_Recipeint_4@gmail.com" & ";" & _
"New_Recipeint_5@gmail.com" & ";" & _
"New_Recipeint_6@gmail.com" & ";" & _
"New_Recipeint_7@gmail.com" & ";" & _
"New_Recipeint_8@gmail.com"
This is the part of the code you need to adjust to include the new recipients (make sure you separate each email address with a semi-colon ";" as per above.
It's a great question and hope this helps you.
Thanks for watching and please share this Excel Power Tip.
where can i get the Macro code please?
Coming soon...
You can download Excel VBA code from this link:
drive.google.com/file/d/1_LYVZ9OwyA1posuBv7M097Dxj-er0evI/view?usp=sharing
If you like my content and downloads, consider supporting me here so I can create more quality content:
paypal.com/donate/?hosted_button_id=KY9HN97ZNPYGU
Hi Sir, I have a doubt. If in a single sheet multiple customers are there and I need only one email for that while creating the bulk email, then what should be the code
If you want to just one email with all the recipients in that email then this code might help you:
Remove the outer loop and create a single loop just to gather all email addresses and put into one string like below to a string variable like below:
strSingleBulkEmailAddress = ""
' Compose the single bulk email To string for multiple recipients via loop
For intRow = 2 To intLastRow
strSingleBulkEmailAddress = strSingleBulkEmailAddress + wSht.Range("C" & intRow).Value + ";"
Next intRow
Hope this helps you and please share this very useful Excel Power Tip.
@@excelpowertips7447 I am sorry that I explained wrong might be. My doubt is if in a sheet there is a single customer for 5 times but I want to use only one email for those 5 times with a same customer. I can't delete it because different invoices are the for one customer
Why am i getting out of range remark
To help you how are you using my Excel code ?
getting out of range error 9
Hi, the VBA code runs fine for me.
Follow the video and look at the guidance notes on the downloaded VBA code (link in the description) and follow the video tutorial.
Thanks for your interest.