Hello,
I have been reading a lot about macros on MrExcel, and have found answers to 95% of what I'm trying to achieve. I hope this last 5% is an elegant solution...
I have developed a swing-trading model which downloads a time (in cell AR5 of the tab "DJIA Trade Trigger Calcs") and stock data each minute via a web-query, which then re-calculates trade triggers. In this same tab, I have a formula in cell AR15 that equals what I have already entered for a time (in cell A18 of the tab "E-mailTab") to trigger an automatic e-mail to a stock broker. Here's what I have entered in the "DJIA Trade Trigger Calcs" tab via the View Code selection:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("AR5") = Range("AR15") Then
Application.EnableEvents = False
Application.ScreenUpdating = False
Call CDO_Mail_Small_Text
Application.EnableEvents = True
Application.ScreenUpdating = True
MsgBox "E-mail has been sent. System suspended for one minute..."
Application.Wait (Now + TimeValue("00:01:00"))
Call Update_IntraDay_Values
Else
End If
End Sub
This doesn't trigger when AR5 = AR15. Any help would be much appreciated.
I have been reading a lot about macros on MrExcel, and have found answers to 95% of what I'm trying to achieve. I hope this last 5% is an elegant solution...
I have developed a swing-trading model which downloads a time (in cell AR5 of the tab "DJIA Trade Trigger Calcs") and stock data each minute via a web-query, which then re-calculates trade triggers. In this same tab, I have a formula in cell AR15 that equals what I have already entered for a time (in cell A18 of the tab "E-mailTab") to trigger an automatic e-mail to a stock broker. Here's what I have entered in the "DJIA Trade Trigger Calcs" tab via the View Code selection:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("AR5") = Range("AR15") Then
Application.EnableEvents = False
Application.ScreenUpdating = False
Call CDO_Mail_Small_Text
Application.EnableEvents = True
Application.ScreenUpdating = True
MsgBox "E-mail has been sent. System suspended for one minute..."
Application.Wait (Now + TimeValue("00:01:00"))
Call Update_IntraDay_Values
Else
End If
End Sub
This doesn't trigger when AR5 = AR15. Any help would be much appreciated.