E-mail and Excel

W

Want2Learn

In Excel I want to select one or more cells that have e-
mail addresses in them and crate a new e-mail using the
selected addresses as the e-mail addresses. Can it be
done?
 
R

Ron de Bruin

Hi Want2Learn

With a macro you can do this
Do you want to use SendMail code or the Outlook object model ?
What do you want to send?
 
R

Ron de Bruin

Try this

Sub Mail_test()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String
Dim cell As Range
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

For Each cell In Selection
If cell.Value Like "*@*" Then
strto = strto & cell.Value & ";"
End If
Next
If strto = "" Then GoTo Eind
strto = Left(strto, Len(strto) - 1)

With OutMail
.To = strto
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Display
End With
Eind:
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top