ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Emailing in VBA (https://www.excelbanter.com/excel-programming/272712-emailing-vba.html)

Steven Cheng[_2_]

Emailing in VBA
 
I have a spreadsheet that is currently setup with areas
that are noncontiguous and that need to be put to a
spreadsheet and emailed.

I can code the extrapolation of the data but how about the
coding to get the emails to go out to a predesignated
email address. I have the email addresses setup right now
under a range. I don't want to have to press the send key
either.

I am very lazy as there are many individuals that the
reports will be going to and they are all different but
pulling from the same file.

Steven

Steven Cheng[_2_]

Emailing in VBA
 
This is perfect thanks.
-----Original Message-----
Steven,

I think this might be what you want: (amend to your

needs)

Dim eml as string, rng as Range, cel as Range

subj = "Today's output"

Set rng = Sheets("Sheet1").Range("A1:A5")

For each cel in rng
eml = cel.Text
ActiveWorkbook.SendMail _
Recipients:=eml, _
Subject:=subj, ReturnReceipt:=True
Next

set rng = Nothing

steve
"Steven Cheng" wrote in message
...
I have a spreadsheet that is currently setup with areas
that are noncontiguous and that need to be put to a
spreadsheet and emailed.

I can code the extrapolation of the data but how about

the
coding to get the emails to go out to a predesignated
email address. I have the email addresses setup right

now
under a range. I don't want to have to press the send

key
either.

I am very lazy as there are many individuals that the
reports will be going to and they are all different but
pulling from the same file.

Steven



.


steve

Emailing in VBA
 
Steven,

Glad to help!

steve

"Steven Cheng" wrote in message
...
This is perfect thanks.
-----Original Message-----
Steven,

I think this might be what you want: (amend to your

needs)

Dim eml as string, rng as Range, cel as Range

subj = "Today's output"

Set rng = Sheets("Sheet1").Range("A1:A5")

For each cel in rng
eml = cel.Text
ActiveWorkbook.SendMail _
Recipients:=eml, _
Subject:=subj, ReturnReceipt:=True
Next

set rng = Nothing

steve
"Steven Cheng" wrote in message
...
I have a spreadsheet that is currently setup with areas
that are noncontiguous and that need to be put to a
spreadsheet and emailed.

I can code the extrapolation of the data but how about

the
coding to get the emails to go out to a predesignated
email address. I have the email addresses setup right

now
under a range. I don't want to have to press the send

key
either.

I am very lazy as there are many individuals that the
reports will be going to and they are all different but
pulling from the same file.

Steven



.





All times are GMT +1. The time now is 06:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com