S
susan
Hi
i have a single sheet with these 2 events:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Private Sub Worksheet_Change(ByVal Target As Range)
Is there a particular order of execution between these two in excel?
Also how can I disable the selectionchange from executing if the user
deletes a value? When the value is deleted it puts it back
Thank you
Susan Hayes
Private Sub Worksheet_Change(ByVal Target As Range)
Dim mytime
mytime = Now
On Error GoTo ErrHandler
If Target.Column <= 26 Then
Application.EnableEvents = False
If mytime > Range("O" & Target.Row).Value + 0.5 And Range("P"
& Target.Row).Value = 0 And _
Range("H" & Target.Row).Value = Range("S" & Target.Row).Value
Then
Range("C" & Target.Row).Value = "Historical"
End If
End If
ErrHandler:
Application.EnableEvents = True
End Sub
i have a single sheet with these 2 events:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Private Sub Worksheet_Change(ByVal Target As Range)
Is there a particular order of execution between these two in excel?
Also how can I disable the selectionchange from executing if the user
deletes a value? When the value is deleted it puts it back
Thank you
Susan Hayes
Private Sub Worksheet_Change(ByVal Target As Range)
Dim mytime
mytime = Now
On Error GoTo ErrHandler
If Target.Column <= 26 Then
Application.EnableEvents = False
If mytime > Range("O" & Target.Row).Value + 0.5 And Range("P"
& Target.Row).Value = 0 And _
Range("H" & Target.Row).Value = Range("S" & Target.Row).Value
Then
Range("C" & Target.Row).Value = "Historical"
End If
End If
ErrHandler:
Application.EnableEvents = True
End Sub