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?
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
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,
 

Watch MrExcel Video

Forum statistics

Threads
1,123,519
Messages
5,602,141
Members
414,505
Latest member
quoctrungvu99

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
Top