The you can call a function that checks the current values with the previous. I saved the previous in a seperate sheet called "Previous"
Sub PB()
Dim HighValues As Range, PrevHigh As Range
Dim LowValues As Range, PrevLow As Range
Dim i As Long
Set LowValues = Worksheets("October").Range("Q5:Q14")
Set HighValues = Worksheets("October").Range("T5:T14")
Set PrevLow = Worksheets("Previous").Range("Q5:Q14")
Set PrevHigh = Worksheets("Previous").Range("T5:T14")
For i = 2 To 10 Step 2
If HighValues.Cells(i, 1) > PrevHigh.Cells(i, 1) Then
MsgBox "New High in " & HighValues.Cells(i, 1).Offset(-1, 0) & ", Day " & HighValues.Cells(i, 1).Offset(0, 1) & ", Date " & HighValues.Cells(i, 1).Offset(0, 2)
PrevHigh.Cells(i, 1) = HighValues.Cells(i, 1)
End If
If LowValues.Cells(i, 1) < PrevLow.Cells(i, 1) Then
MsgBox "New Low in " & LowValues.Cells(i, 1).Offset(-1, 0) & ", Day " & LowValues.Cells(i, 1).Offset(0, 1) & ", Date " & LowValues.Cells(i, 1).Offset(0, 2)
PrevLow.Cells(i, 1) = LowValues.Cells(i, 1)
End If
Next i
End Sub
Bookmarks