I get this error anytime I try to delete the contents of any cell (by clicking the DELETE key. Backspace works OK.) OR if I try to CLEAR CONTENTS in any cell in columns D or P.
I do have a VBA code setup that involves those cells in those columns. Any idea how to fix this problem?
Here's the code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CurrRow As Long
CurrRow = Target.Row
If Target.Column = 4 Then
If Target.Value = "" Then
If Cells(CurrRow, 2) = 408 Then Cells(CurrRow, 2) = 43
If Cells(CurrRow, 2) = 406 Then Cells(CurrRow, 2) = 398
ElseIf Target.Value <= 3030 And Cells(CurrRow, 2) = 43 Then Cells(CurrRow, 2) = 408
ElseIf Target.Value > 3030 And Cells(CurrRow, 2) = 408 Then Cells(CurrRow, 2) = 43
ElseIf Target.Value <= 8500 And Cells(CurrRow, 2) = 398 Then Cells(CurrRow, 2) = 406
ElseIf Target.Value > 8500 And Cells(CurrRow, 2) = 406 Then Cells(CurrRow, 2) = 398
End If
ElseIf Target.Column = 16 Then
If Target.Value = "" Then
If Cells(CurrRow, 14) = 408 Then Cells(CurrRow, 14) = 43
If Cells(CurrRow, 14) = 406 Then Cells(CurrRow, 14) = 398
ElseIf Target.Value <= 3030 And Cells(CurrRow, 14) = 43 Then Cells(CurrRow, 14) = 408
ElseIf Target.Value > 3030 And Cells(CurrRow, 14) = 408 Then Cells(CurrRow, 14) = 43
ElseIf Target.Value <= 8500 And Cells(CurrRow, 14) = 398 Then Cells(CurrRow, 14) = 406
ElseIf Target.Value > 8500 And Cells(CurrRow, 14) = 406 Then Cells(CurrRow, 14) = 398
End If
End If
End Sub
Bookmarks