Need some VB guru's help...how to send multiple emails

L

Legacy 55058

Guest
I am looking to send multiple emails to different users from excel, and to email a different range in each separate email. I am not looking to send as an attachment, just within the body of the email. I have played with some code but only could get one email to go out, not multiple :eek:
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

NateO

Legend
Joined
Feb 17, 2002
Messages
9,700
Hello,

Well, hopefully you've seen this using Outlook:

http://www.mrexcel.com/board2/viewtopic.php?t=54018

Now, what you want to do is iterate, like looping through an array, e.g.,

http://www.mrexcel.com/board2/viewtopic.php?p=536376#536376

Now note, that's Lotus Note's Code, so if you're using Outlook, you don't want any of that LotusScript, etc... but you want the concept of iterating through an array, so focus on these code bits:

Code:
Let emailArr = Array("Email1@y.com", "Email2@y.com", "Email3@y.com", "Email4@y.com", _
    "Email5@y.com", "Email6@y.com", "Email7@y.com")


For i = LBound(myArr) To UBound(myArr)

    MailDoc.SendTo = emailArr(i)
Clear as mud? :)
 
L

Legacy 55058

Guest
That is fantastic......I am just starting to get into VBA, and learning the whole looping functionality. This is great. Thanks!!! :biggrin:
 

NateO

Legend
Joined
Feb 17, 2002
Messages
9,700
You are welcome.

Yep, Excel's pretty slick software, offering some really choice native functionality. And, the bonus is the ability to augment native functionality and interface other Apps via VBA, a powerful, hi-level language.

Good hunting and happy new year. :)
 

Watch MrExcel Video

Forum statistics

Threads
1,118,524
Messages
5,572,640
Members
412,478
Latest member
MakeItWorkVBA
Top