Emailing in VBA

S

Steven Cheng

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
 
S

Steven Cheng

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



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top