[vba]


Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range

On Error GoTo ws_exit

Application.EnableEvents = False

If Target.Row > 1 Then

If Not Intersect(Target, Me.Columns(1)) Is Nothing Then

For Each cell In Target

cell.Offset(0, 2).Value = 2
Next cell

ElseIf Not Intersect(Target, Me.Columns(4)) Is Nothing Then

For Each cell In Target

If cell.Value > 0 Then

cell.Offset(0, 4).Value = "DEP"
Else

cell.Offset(0, 4).Value = "WD"
End If
Next cell
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub
[/vba]