I want a worksheet change macro, that pops up a Messagebox whenever a value higher than 8 is put in one of the cells in range (F14:J26) and if a value greater than 300 is put in cell C37.
My problem is that cell C37 is not filled out manually but has a formula in it so it is a calculation of two other cells. And I think excel doesn't recognize this as a value and therefore doesn't do anything whenever the result in that cell is higher than 300.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("F14:J26")) Is Nothing Then
If Target.Value > 8 Then
MsgBox "Was that accepted?"
End If
End If
If Not Application.Intersect(Target, Range("C37")) Is Nothing Then
If Target.Value > 300 Then
MsgBox "Was that accepted?"
End If
End If
End Sub
The first part of the code works as it should. But the second part as explained above doesn't. I also tried to split it in two separate codes but that shows a bug. Any help on this would be very much appreciated!