View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Add a cc to this code

Hi Annette

Not possible with SendMail

If you use Outlook?
Look at the code for Outlook in the same section of my page
http://www.rondebruin.nl/sendmail.htm#every

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


"Annette" wrote in message ...
How can I add a cc ... the line will be standard so I can add it as an "And"
... but I don't know how to do this:
I want to cc this to an address such as every time I
run this.

-------------------------
Sub Mail_every_Worksheet()
Dim sh As Worksheet
Dim WB As Workbook
Dim strdate As String

Application.ScreenUpdating = False
For Each sh In ActiveWorkbook.Worksheets
If sh.Range("a2").Value Like "*@*" Then
strdate = Format(Now, "dd-mm-yy h-mm-ss")
sh.Copy
Set WB = ActiveWorkbook
With WB
.SaveAs "Sheet " & sh.name & " of " _
& ActiveWorkbook.name & " " & strdate & ".xls"
.SendMail ActiveSheet.Range("a2").Value, _
"SCSU Referrals"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
End If
Next sh
Application.ScreenUpdating = True
End Sub