• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Multiple emails from excel

Deva

New Member
helloo guysss, I am deva from malaysia. Currently developing a license reminder task... I would like to ask u all some suggestions how to send multiple emails as for one license in one cell. I have tried in one cell to add more than one but it does not work. Is there anything that I can format it in a way in vba to send multiple users emails for one particular license.. Your help and suggestions is highly appreciated thank you. sorry to disturb u all.
 
Last edited:
Separate the email addresses with a semicolon. That way when XL passes the information to Outlook, it will get parsed correctly.

E.g., Cell A2 has value of:
John@example.com; Jane@example.com

and then your code does something like
Code:
.To = Range("A2").Value

Thank You Luke. It works now. but with the specific cell like D6 or A2 only. How to say for whole rows of A or D. TQQ :)

for example:
column D is the emails. And If i say .To=Range("D1").Value
It will send to the first one. How to say for whole rows in column D. because i try with .To=Range("D").Value but it does not work. anythg i missed out Luke??

Kindly help me tqqq sir.

A B C D
Microsoft 3/25/2016 User abc@yahoo.com; def@yahoo.com;
Microsoft 3/5/2016 User abc@yahoo.com; def@yahoo.com;
Microsoft 3/19/2016 User abc@yahoo.com; def@yahoo.com;
Microsoft 3/19/2016 User abc@yahoo.com; def@yahoo.com;
 
Last edited:
You will need to loop over each cell and concatenate the string. First, just saying all of col D is probably a bit much, as I'm guessing we're not really using every cell in col D. But we could do something like this:
Code:
Sub ExampleLoop()
Dim lastRow As Long
Dim myList As String
Dim i As Long

'Find the last cell in col D
lastRow = Cells(Rows.Count, "D").End(xlUp).Row

'Loop over each cell in row 2 to the end
For i = 2 To lastRow
    myList = myList & Cells(i, "D").Value & ";"
Next i

'You can now use the myList variable somewhere
MsgBox myList

End Sub
 
Back
Top