VBA: Email individual Sheets to email value in cell

Eean

New Member
Joined
May 26, 2010
Messages
44
I want to email each sheet in my workbook (30 sheets) to the email address in cell A1.
The email address is different on each sheet.
What I have below works for the active sheet but isn't attaching it.


Sub Mailmacro()

Dim OutApp As Object
Dim OutMail As Object
Dim mymail As String

mymail = Range("A1").Value
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = mymail
.CC = ""
.BCC = ""
.Subject = "Email subject "
.Body = "Body"
.Attachments.Add ActiveWorksheet.FullName

.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

Can anyone help?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
If you want to attach individual sheets to individual recipients, then you can make a temporary copy of the worksheet as a new workbook, attach it and then kill it.

I believe that Ron DeBruin has code to do that at Excel Automation - Ron de Bruin.

HTH,
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top