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

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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,214,822
Messages
6,121,767
Members
449,049
Latest member
greyangel23

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