+ Reply to Thread
Results 1 to 3 of 3

Macro to send email when calculate cell reaches 0

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Macro to send email when calculate cell reaches 0

    Morning,

    Can anyone help with the above? I just need a simple email to be sent out when a cell reaches 0

    Many thanks

  2. #2
    Forum Contributor
    Join Date
    04-25-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: Macro to send email when calculate cell reaches 0

    Change A1 to suit:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Intersect(Target, Range("a1")).Value = 0 Then
        Dim OlApp As Object
        Dim OlMail As Object
    
        Set OlApp = CreateObject("Outlook.Application")
        Set OlMail = OlApp.CreateItem(olMailItem)
        
        OlMail.Recipients.Add "[email protected]"
        
        OlMail.Subject = "Whatever"
        
        OlMail.Body = "Insert Body Text Here"
        
        'OlMail.attachments.add "file to path (if necessary)"
        
        OlMail.Send
        
        MsgBox "Done!"
        
        Set OlApp = Nothing
        Set OlMail = Nothing
    End If
    
    End Sub
    And make sure to add the Outlook library in your references

  3. #3
    Forum Contributor
    Join Date
    03-06-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    352

    Re: Macro to send email when calculate cell reaches 0

    Great thanks I'll give that a try

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to send email using lotus notes based upon cell value
    By jt1672 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-28-2013, 07:15 AM
  2. Macro to send email with signature depending on cell content
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2013, 11:39 AM
  3. Macro to send two different mail when a cell reaches two different values.
    By Frankito in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2013, 09:36 AM
  4. [SOLVED] Sending Email when cell value reaches above 5: Getting a Compile Error
    By photochic10 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-14-2013, 01:59 PM
  5. [SOLVED] Can email be sent when cell value reaches specific value
    By Kevin Singh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2005, 02:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1