Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
See
http://www.rondebruin.nl/mail/tips1.htm For example Dim MyArr As Variant MyArr = Sheets("mysheet").Range("C1:C10") ..SendMail MyArr, "This is the Subject line" -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "jlclyde" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Email addresses in Excel need to format for mass email | Excel Worksheet Functions | |||
Transfer Email addresses from spreadsheet to email address book | Excel Discussion (Misc queries) | |||
Email editor closes when forwarding Excel-embedded email | Setting up and Configuration of Excel | |||
working on excel document in email saved changes in email not in . | Excel Discussion (Misc queries) | |||
body of email disappears when I send an email from Excel | Excel Discussion (Misc queries) |