OK...here is some code for you to try.
I stress that it is only tested with a handful of emails (for obvious reasons), however I am happy to help you implementing the code if you have problems.
Public sTo As String
Public sBCC As String
Private Sub CommandButton1_Click()
Dim ocell As Range
Dim Count As Long
If MsgBox("Are you sure you want to continue with the email?" _
, vbYesNo, "NewCopy") = vbNo Then Exit Sub
sTo = Range("MyEmail").Value
sBCC = ""
For Each ocell In Range("EmailAddresses")
' loop for all non blank email addresses
If ocell.Value <> vbNullString Then
Count = Count + 1
sBCC = sBCC & ocell.Value & ";"
If Count = 50 Then
Call CopyandMail
Count = 0
sBCC = ""
End If
End If
Next ocell
If Count > 0 Then
Call CopyandMail
End If
End Sub
Sub CopyandMail()
Dim OutApp As Object
Dim OutMail As Object
On Error Resume Next
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
'Copy the Checked Sheets to a new workbook for each email addressee.
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = sTo
.CC = ""
.BCC = sBCC
.Subject = Range("EmailSubject").Value
.Body = Range("EmailMessage").Value
.Attachments.Add Range("EmailFile").Value
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
'.Display
'Application.Wait (Now + TimeValue("0:00:02"))
'Application.SendKeys "%s"
End With
Set OutMail = Nothing
Set OutApp = Nothing
Application.ScreenUpdating = True
Application.EnableEvents = True
Application.DisplayAlerts = True
End Sub
Bookmarks