Email with excel

J

jlclyde

Here is the code that i have so far. The range A1:A2 is where emails
are stored. The range will become larger when this works correctly.
I am trying to email multiple recipients based on information that I
have in cells on a worksheet. Any guidance woudl be greatly
appreciated.

Sub SendActiveWorkbook()
Dim eMail As String
eMail = ConcRange(Range("A1:A2"), "; ", False, False)
ActiveWorkbook.SendMail _
Recipients:=eMail, _
Subject:="Try Me " & Format(Date, "dd/mmm/yy")
End Sub


Here is the code for the ConcRange function.

Function ConcRange(Substrings As Range, Optional Delim As String =
";", _
Optional AsDisplayed As Boolean = False, Optional SkipBlanks As
Boolean = False)
Dim CLL As Range
For Each CLL In Substrings.Cells
If Not (SkipBlanks And Trim(CLL) = "") Then
ConcRange = ConcRange & Delim & IIf(AsDisplayed,
Trim(CLL.Text), _
Trim(CLL.Value))
End If
Next CLL
ConcRange = Mid$(ConcRange, Len(Delim) + 1)
End Function

Thank You,
Jay
 

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