Cell Value Change - VBA

damian

Registered User.
Local time
Today, 17:32
Joined
Jun 27, 2004
Messages
87
I’d like to develop the following code in order to trigger another section of code (in this case ‘Mail_CDO’) not only when the cell value is greater than 7000 but also in the event that A1’s value remains the same for,say, more than 10 minutes. Any ideas?



Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1"), Target) Is Nothing Then
If IsNumeric(Target.Value) And Target.Value > 7000 Then
Mail_CDO
End If
End If
End Sub
 
Psuedocode:
global variable LastUpd (set on the Open event)
global variable AOne
If (AOne = Range("A1").value AND TIMER - LastUpd > (10 minutes * 60 seconds))
OR
(If IsNumeric(Target.Value) And Target.Value > 7000)
THEN
Mail_CDO
AOne = Range("A1").value
If target = A1 then LastUpd = TIMER
 

Users who are viewing this thread

Back
Top Bottom