send_mail function question

ass98

New Member
Joined
Aug 30, 2002
Messages
31
i have a piece of code below which will email the current .xls file to everyone whos email address is in a range of cells specified

Sub Send_email()

Application.Dialogs(xlDialogSendMail).Show arg1:=Range("E3:E100").Value

End Sub

my problem is how can i email a particular sheet instead of the whole workbook?
This message was edited by ass98 on 2002-09-01 13:00
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try this code.

<pre>
Sub mailsheet()
ActiveSheet.Copy
ActiveWorkbook.SendMail _
Recipients:="me@abc.com", _
Subject:="(" & ActiveSheet.Name & ") Test 1,2"
ActiveWorkbook.Close False
End Sub
</pre>

Hope it helps
 
Upvote 0
yes you can. If you have a sort list you can hardcode them.<pre>
Recipients:=Array("me@abc.com", "you@xyz.com")</pre>

For a long list use a range.<pre>
Sub mailsheet()
Dim mailrange As Range

Set mailrange = ActiveSheet.Range("A1:A10")
ActiveSheet.Copy
ActiveWorkbook.SendMail _
Recipients:=mailrange.Value, _
Subject:="(" & ActiveSheet.Name & ") Test 1,2"

ActiveWorkbook.Close False
End Sub</pre>

Or you could loop through your range and send individual mail messages
This message was edited by Dragracer on 2002-09-01 16:15
 
Upvote 0

Forum statistics

Threads
1,218,560
Messages
6,143,203
Members
450,469
Latest member
brent3162

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