I have VBA codes: I'm looking to Call macro only when tow condition are meet: D5<0 and Closing Workbook, then SendEmail. It is working but Im receiving one email when condition D5 <0 and other email when I close workbook: Please help
Sheet2:
Private Sub Worksheet_Calculate()
If IsNumeric(Range("D5")) Then
If Range("D5").Value < 0 Then
'MsgBox "Range D5 has reached is limit of <=0", vbInformation
Call SendEmail
End If
End If
End Sub
Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
'MsgBox "This Workbook is saved."
Call SendEmail
End Sub
Sheet2:
Private Sub Worksheet_Calculate()
If IsNumeric(Range("D5")) Then
If Range("D5").Value < 0 Then
'MsgBox "Range D5 has reached is limit of <=0", vbInformation
Call SendEmail
End If
End If
End Sub
Workbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
'MsgBox "This Workbook is saved."
Call SendEmail
End Sub