Hi, I thought maybe this problem should have it's own thread as its changed from my initial challenge!
I need help please to convert the following script from Worksheet_change to Worksheet_calculate as the cell that triggers the event is actually altered as a result of a formula, not manually by the user.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Range("B5")
If Not Intersect(Target, rng) Is Nothing Then
If rng = "FO" Then
If Range("R1").Value >= "1" Then Exit Sub
MsgBox ("Congratulations, you have peen promoted to " & Range("b5").Value)
Range("R1") = Range("R1") + 1
ElseIf rng = "FL" Then
If Range("R2").Value >= "1" Then Exit Sub
MsgBox ("Congratulations, you have peen promoted to " & Range("b5").Value)
Range("R2") = Range("R2") + 1
End If
End If
Set rng = Nothing
End Sub
Can someone advise please how to convert this over? Other than this issue the script seems to work pretty well.
Thanks very much!
Recon.
I need help please to convert the following script from Worksheet_change to Worksheet_calculate as the cell that triggers the event is actually altered as a result of a formula, not manually by the user.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim rng As Range
Set rng = Range("B5")
If Not Intersect(Target, rng) Is Nothing Then
If rng = "FO" Then
If Range("R1").Value >= "1" Then Exit Sub
MsgBox ("Congratulations, you have peen promoted to " & Range("b5").Value)
Range("R1") = Range("R1") + 1
ElseIf rng = "FL" Then
If Range("R2").Value >= "1" Then Exit Sub
MsgBox ("Congratulations, you have peen promoted to " & Range("b5").Value)
Range("R2") = Range("R2") + 1
End If
End If
Set rng = Nothing
End Sub
Can someone advise please how to convert this over? Other than this issue the script seems to work pretty well.
Thanks very much!
Recon.