Send Email from Macro VBA Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I don't want to send a workbook. My coding is all set. I have the macro
run, and if a certain value is reached, then I want to send an email out to 2
people. Simple as that. But I can't figure out the coding. Will someone
PLEASE answer me using my examples listed below?

I want the subject of the email to say = "Value has been reached"
I want to send the email to = "(e-mail address removed)" AND "(e-mail address removed)"
I don't want any attachments OR body text.
Just send it to certain people AND a subject heading.

Can someone please help WITHOUT directing me to someone else's website?

Thx
 
Hi,


You could use something like this: ( I have it running in my
applicatin)


Code:
--------------------
' Select the range of cells on the active worksheet.
ActiveSheet.Range("B4:F49").Select
Nombre= email.Text
Asunto = Asunto.Text
Intro = Intro.Text
If Ccmail.Text = "inserte e-mail adicional (opcional)" Then
ConCopia = ""
Else
ConCopia = Ccmail.Text
End If

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True

' Set the optional introduction field thats adds
' some header text to the email body. It also sets
' the To and Subject lines. Finally the message
' is sent.

With ActiveSheet.MailEnvelope
.Introduction = Intro
.Item.To = nombre
.Item.Subject = Asunto
.Item.CC = ConCopia
.Item.Send
End With

End Sub
--------------------


You have to adjust it a little bit, but is the best answer i found,
even better that the link provided in the last response ( I looked them
all!!).


Hope this helps


Regards

Jose Luis
 

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

Back
Top