View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] s_smith_iet@hotmail.com is offline
external usenet poster
 
Posts: 66
Default Email using a macro

This was the 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("A1"), rng) Is Nothing Then
If Range("A1").Value 200 Then YourMacroName
End If
End If
EndMacro:
End Sub



It always ended on error when I used a simple macro the would open a
msg box.... but it seems like ever time I click on a cell it would
come on because the cell it as looking at was still 45.....

what happens is once it gets to 50 the operator is going to perform a
maintenance and then use a dialog box to enter in what he/she
performed which will bring the number down to zero again...then
eventually it'll go back to 45 (it takes about a month for this
process to end)....so if I could get an email sent at 45 and then when
it is at 0 that would work. so this email would like the supervisor
know that the maintenance was coming up and then once it has been
completed. It would also be good to send out another email if it goes
over 50 because it is supposed to be completed at the 50th cycle max.