View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Simon Lloyd[_722_] Simon Lloyd[_722_] is offline
external usenet poster
 
Posts: 1
Default SendMail to multiple recipients, one variable, and one constant


Craig i have this that i use, it creates an input box so you can typ
the recipient, your welcome to use or modify it!

Sub Mail_SheetsArray()
Dim wb As Workbook
Dim strdate As String
Dim I2 As Integer
strdate = Format(Now, "dd-mm-yy hh-mm-ss")
Application.ScreenUpdating = False
ActiveWindow.SelectedSheets.Copy
Set wb = ActiveWorkbook
For I2 = 1 To 1 '[I have 1 to1 here so the box oly pops up once bu
you could change the end figure to suit]
t1 = InputBox("Enter E-mail Address", "Who To Send To?", "")
With wb
.SaveAs "ANYTHING" & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail t1 ', "This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Next
Application.ScreenUpdating = True

End Su

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=54376