#1   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 13
Default email with condition

HI All,
I am working on a worksheet which has a range N11: N33 and has a Numeric
Value,
I want to send a email directly from EXCEL if any cell in this range gets
the value 2.
If there is more than 1 cell which has value more than 2, two different mail
should go with a Text body, I am writing a code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo EndMacro
If Not Target.HasFormula Then
Set rng = Target.Dependents
If Not Intersect(Range("N11"), rng) Is Nothing Then
If Range("N11").Value 2 Then Mail_with_Outlook2
'(Macro to send email)
ElseIf Range("N12").Value 2 Then Mail_with_Outlook1
' (Macro to send email2)
.......
.......

If I use ElseIf, other condition do not get validated if the first condition
is fulfilled

any suggestions??

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
***** PLEASE HELP **** Send an email from Excel to outlook with an automatic macro SAM SEBAIHI Excel Discussion (Misc queries) 0 November 11th 06 09:17 AM
Email from excel.. please help?? SAM SEBAIHI Excel Discussion (Misc queries) 0 November 11th 06 07:35 AM
sending email from excel not working Tripp Excel Discussion (Misc queries) 2 February 1st 06 09:42 PM
Move a Column of 500 Email Addresses into BCC Field of an Email Mark Excel Worksheet Functions 9 July 27th 05 05:07 AM
body of email disappears when I send an email from Excel ~A Excel Discussion (Misc queries) 0 February 25th 05 11:55 PM


All times are GMT +1. The time now is 11:19 AM.

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

About Us

"It's about Microsoft Excel"