Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Button in Excel

Status
Not open for further replies.

chuckbjr

IS-IT--Management
May 30, 2003
5
US
I have some experience with VB (from what I've done in Access) but I'm completely lost...

I have a workbook with three worksheets. On the first worksheet I have a place for an email address and what I'd like to use for a Subject. On the third worksheet I'd like to add a button that would send the defined contents of that sheet (say a print area) as an HTML attachment in an email that will open and be populated by the aformentioned email address and subject. Anyone have an idea to code this? Thanks.

c b j
 
Hi Chuckbjr
Please find below an email sender macro
All you will need to do is loop through the cells in your excel sheet and set the "To", "CC", "subject" and "body" to the cell information on your sheet.

If I can be of any further help
Simmy123@talk21.com
Regards
Simmy

Sub Emailer
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)
With objMail
.To = "my.name@yahoo.com"
.CC = "your.name@yahoo.com"
.Subject = "My Subject"
.Body = "Hello!"
.Send
End With
Set objMail = Nothing
Set objOL = Nothing
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top