D
Douglas
The code below works just fine -- but only if the target
sheet has focus.
I have 2 sheets:
Sheet1 is where the user enters some employee data,
i.e. Full Time/Part Time;
Sheet2 (the target) allows the user to post prior
service history. But the computation is a bit different
for a part time employee.
Once both sheets are are completed all is well. UNLESS
the user returns to sheet1 and changes a Full Timer to a
Part Timer. If that happenes I need to reset sheet2 to
its initial values.
Attempts to watch for the change from sheet1, the call to
my macro (which is in a module) amounts to a no-op.
What now?
Doug
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then
Exit Sub
On Error GoTo CleanUp:
With Target
If .Value Then
Application.EnableEvents = False
Call ResetPriorService
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub
sheet has focus.
I have 2 sheets:
Sheet1 is where the user enters some employee data,
i.e. Full Time/Part Time;
Sheet2 (the target) allows the user to post prior
service history. But the computation is a bit different
for a part time employee.
Once both sheets are are completed all is well. UNLESS
the user returns to sheet1 and changes a Full Timer to a
Part Timer. If that happenes I need to reset sheet2 to
its initial values.
Attempts to watch for the change from sheet1, the call to
my macro (which is in a module) amounts to a no-op.
What now?
Doug
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A1")) Is Nothing Then
Exit Sub
On Error GoTo CleanUp:
With Target
If .Value Then
Application.EnableEvents = False
Call ResetPriorService
End If
End With
CleanUp:
Application.EnableEvents = True
End Sub