Please take with me how I try to work out as succinctly as possible:
I have a basic trading table that includes prices for living houses, and if the price exceeds my target price for entering the cell, say, AB4, the text βBUYβ is displayed. If I have a stock, and the price falls below my target, then βSELLβ is displayed in the same cell. In any case, the spreadsheet will also automatically send the order to complete the trade.
All I wanted was msgbox to remind me to take notes whenever a signal appears. I need only one reminder, but I need it, because I always forget.
Having read many past posts here, this was my first attempt:
Private Sub worksheet_calculate() If Range("AB4").value = "BUY" Or Range("AB4").value = "SELL" Then MsgBox ("Record Catalyst") End If End Sub
It seemed like I was working, but as soon as I click OK, msgbox will appear again. As long as the text βBUYβ or βSELLβ is displayed, msgbox just wonβt go away, no matter how many times I clicked it.
So, I searched again and found a way to make the msgbox message only once:
Private Sub worksheet_calculate() If ActiveSheet.Range("BV4").Text = "Triggered" Then Exit Sub If Range("AB4").value = "BUY" Or Range("AB4").value = "SELL" Then MsgBox ("Record Catalyst") ActiveSheet.Range("BV4") = "Triggered" End If End Sub
Suppose you are working in charm EXCEPT mode, if I do not press "ok" to disappear msgbox, my whole table stops doing anything (i.e. prices are no longer updated, calculations are no longer performed, etc.) ! It just seems to me that I waited for me to click on "okay." This is a serious problem, because if I am gone when msgbox appears and the spreadsheet is stopped, then the price of another stock in my portfolio will reach a goal that the spreadsheet does not even know, let alone automatically cancel the order.
Why does this simple procedure stop the spreadsheet and how can I solve my original "simple" problem with msgbox? I do not want to use a conditional formatting route in a spreadsheet, because it is already cluttered with too many conditionally formatted cells.
Thank you guru!