I have an excel sheet, with column both A、B、C、D.
Both C & D number changes all the time (they have different criteria), since it calculates by stock data that fetches in real-time.
I need message box to pop up both when C & D matches my target value, and showing the the ticker in column A, the name in column B, and the number in C/D.
With the help I know the code when there is only column C:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.column = 3 And Target.value >= -4 And Target.value <= 4 Then
Call MsgBoxMacro(Target.value, Target.column, Target.row)
End If
End Sub
Sub MsgBoxMacro(value, column, row)
MsgBox "Ticker: " & Cells(row, column - 2) & vbNewLine & "Stock Name: " & Cells(row, column - 1) & vbNewLine & "Variable Value: " & value
End Sub
I don't know what to do, when I want to add column D data into the code. (so i can have message box pop up when D number reaches the criteria) please help.
Thank you!