I have the following code set up in a worksheet (actually on two worksheets in the same file). The first part is to move lines from one sheet to another based on changing a drop-down selection, the second part is to allow for multiple selections in a drop-down list (in a different cell to the first part).
The code was set up yesterday and it worked fine, but today it isn't working. I haven't changed the code itself since then, and I've tried closing/opening the file again but still isn't working.
Any ideas on why it suddenly stopped functioning? Thank you!
Private Sub Worksheet_Change(ByVal Target As Range)
Worksheet_Change_A Target
Worksheet_Change_B Target
End Sub
Private Sub Worksheet_Change_A(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Column = 7 And Target.Row > 2 And Target.Value = "Complete" Then
Application.EnableEvents = False
Range(Cells(Target.Row, "A"), Cells(Target.Row, "L")).Copy Sheets("Completed Projects").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Rows(Target.Row).Delete
Application.EnableEvents = True
End If
End Sub
Private Sub Worksheet_Change_B(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
Application.EnableEvents = True
On Error GoTo Exitsub
If Target.Column = 5 Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & vbNewLine & Newvalue
Else:
Target.Value = Oldvalue
End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub