Please be careful to post in the correct forum.
This post was posted in the "Tips and Tutorials". I moved it for you.
As for your query, look at http://www.rondebruin.nl/win/s1/outlook/bmail9.htm
This forum has been moved to TeachExcel.com
Ask all future questions in the New Excel Forum.
ExcelKey
Private Sub Worksheet_Calculate()
If Range("A1").Value >= 60000 Then
MsgBox "The value is 60000 or more" '<-- comment out if not wanted
Call SendTheEmail
End If
End Sub
Private Sub SendTheEmail()
' see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Hi there" & vbNewLine & vbNewLine & _
"The whatever it is has gone over 60000"
On Error Resume Next
With OutMail
.To = "tarkeshwari.Sengupta@in.fujitsu.com"
.CC = ""
.BCC = ""
.Subject = "60000 or more"
.Body = strbody
.Display 'or use .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Return to Macros and VBA Questions
Users browsing this forum: No registered users and 100 guests