Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to send different ranges to multiple e-mail recipients

I am trying to set up a macros that will allow me to send a specific range of
cells in a worksheet to multiple e-mail recipients. I don't have any problem
creating the first range of cells and e-mail address, but I am not sure how
to set up the next commands. Do you have any suggestions?

Sub MacroTest()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:H7", "A9:H12").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = False

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "This is a sample worksheet."
.Item.To = "
.Item.Subject = "Test"
.Item.Send
End With

End Sub


--
Thank you,
Meghan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to send different ranges to multiple e-mail recipients

Hi Meghan

The same range to more people ?
Maybe
http://www.rondebruin.nl/mail/tips2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Meghan" wrote in message ...
I am trying to set up a macros that will allow me to send a specific range of
cells in a worksheet to multiple e-mail recipients. I don't have any problem
creating the first range of cells and e-mail address, but I am not sure how
to set up the next commands. Do you have any suggestions?

Sub MacroTest()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:H7", "A9:H12").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = False

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "This is a sample worksheet."
.Item.To = "
.Item.Subject = "Test"
.Item.Send
End With

End Sub


--
Thank you,
Meghan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to send different ranges to multiple e-mail recipients

Hi Ron,

I'm trying to send different ranges to different people...each range has
information pertaining to a specific employee. Thanks!

"Ron de Bruin" wrote:

Hi Meghan

The same range to more people ?
Maybe
http://www.rondebruin.nl/mail/tips2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Meghan" wrote in message ...
I am trying to set up a macros that will allow me to send a specific range of
cells in a worksheet to multiple e-mail recipients. I don't have any problem
creating the first range of cells and e-mail address, but I am not sure how
to set up the next commands. Do you have any suggestions?

Sub MacroTest()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:H7", "A9:H12").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = False

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "This is a sample worksheet."
.Item.To = "
.Item.Subject = "Test"
.Item.Send
End With

End Sub


--
Thank you,
Meghan




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to send different ranges to multiple e-mail recipients

Not much time now but you can create two arrays and loop through them

In this macro I do it with sheetname and e-mail addresses
Try to use it in your macro

Post back if you have problems
I check this posst later this evening
See also this page for another way to do it
http://www.rondebruin.nl/mail/folder3/mail4.htm


The example below will send each sheet in the Shname Array
to a person In the Addr Array.
In this example four separate mails will be send with one sheet.

Sheet1 to
Sheet2 to

Sheet3 to

Sheet4 to



Sub Mail_test()
Dim wb As Workbook
Dim strdate As String
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer

strdate = Format(Now, "dd-mm-yy h-mm-ss")
Shname = Array("Sheet1", "Sheet2", "Sheet3", "Sheet4")
Addr = ", ", ", ")

Application.ScreenUpdating = False

For N = LBound(Shname) To UBound(Shname)
Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Sheet " & Shname(N) _
& " " & strdate & ".xls"
.SendMail Addr(N), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next N
Application.ScreenUpdating = True
End Sub




--
Regards Ron de Bruin
http://www.rondebruin.nl



"Meghan" wrote in message ...
Hi Ron,

I'm trying to send different ranges to different people...each range has
information pertaining to a specific employee. Thanks!

"Ron de Bruin" wrote:

Hi Meghan

The same range to more people ?
Maybe
http://www.rondebruin.nl/mail/tips2.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Meghan" wrote in message ...
I am trying to set up a macros that will allow me to send a specific range of
cells in a worksheet to multiple e-mail recipients. I don't have any problem
creating the first range of cells and e-mail address, but I am not sure how
to set up the next commands. Do you have any suggestions?

Sub MacroTest()
' Select the range of cells on the active worksheet.
ActiveSheet.Range("A1:H7", "A9:H12").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = False

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.
With ActiveSheet.MailEnvelope
.Introduction = "This is a sample worksheet."
.Item.To = "
.Item.Subject = "Test"
.Item.Send
End With

End Sub


--
Thank you,
Meghan






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Would like to send an e-mail to multiple address entered as data. GOBETA Excel Discussion (Misc queries) 1 September 24th 07 03:07 PM
Mail Merge Without Recipients - Is It Something Else? Dave Excel Discussion (Misc queries) 0 September 12th 07 05:10 PM
Email/Mail Merge document lines to specific multiple recipients JDenise Excel Discussion (Misc queries) 1 March 14th 07 01:39 PM
send mail from excel 2000 with multiple attachments ...Patrick[_7_] Excel Programming 6 May 20th 06 12:10 PM
Mail Recipients George Schneider Setting up and Configuration of Excel 3 January 4th 06 08:26 AM


All times are GMT +1. The time now is 09:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"