Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default sending a singular email by selection

Use this then

Sub TestFile2()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Application.ScreenUpdating = False
Set olApp = New Outlook.Application

If ActiveCell.Value Like "*@*" And ActiveCell.Offset(0, 1).Value = "yes" Then
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = ActiveCell.Value
.Subject = "Reminder"
.Body = "Dear " & ActiveCell.Offset(0, -1).Value & vbNewLine & vbNewLine & _
"Generic Email Message Here"
.Send 'Or use Display
End With
Set olMail = Nothing
End If
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Steven" wrote in message ...
Hello all,

I have the following code below from Ron De Bruin's website. What i want is to alter it slightly so that... for example... If

i am on Cell C3 and it contains " and i run the macro, it will email with a generic message.
Another example, if I am on cell C4 and it conaitns the text " it will send the generic text email to
. Any ideas?

Sub TestFile2()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application

If cell.Offset(0, 1).Value < "" Then
If cell.Value Like "*" And cell.Offset(0, 1).Value = "yes" Then
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Value
.Subject = "Reminder"
.Body = "Dear " & cell.Offset(0, -1).Value & vbNewLine & vbNewLine & _
"Generic Email Message Here"
.Send 'Or use Display
End With
Set olMail = Nothing
End If
End If
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default sending a singular email by selection

Thanks Ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
Sending a Spreadsheet as an Email Attachment vs. Imbedded in Email billbrandi Excel Discussion (Misc queries) 1 April 3rd 08 03:44 AM
sending updates through email Ruth Excel Discussion (Misc queries) 2 May 6th 07 04:21 PM
Email sending colourp Excel Discussion (Misc queries) 1 January 13th 06 01:13 AM
Conditional email sending brownc5 Excel Programming 2 August 19th 03 09:53 PM


All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"