Problem w/ worksheet change event
Hi all. I have the following inside a worksheet change event:
'Lock/Unlock cells based on FT/PT status
If .Column = 5 And .Row 11 And .Row < 312 Then
Application.EnableEvents = False
If .Value = "PT" Then
Cells(.Row, 6).Value = 20
Else
Cells(.Row, 6).Value = 40
End If
Application.EnableEvents = True
End If
I the user highlights and clears contents of column 5 and 6 at the same time
(ie E5:F5), I get a type mismatch error on the line If .Value = "PT" Then,
and the change event won't fire unless I completely clode out of excel and
re-open. Any ideas on how to prevent that from happening?
|