I3atnumb3rs
New Member
- Joined
- Nov 2, 2018
- Messages
- 34
Hi,
Checked a bunch of threads and am not able to get more than one intersect statement to run in my workbook. Each statement runs perfectly as seperate statements. I want an entire row to be move to a tab of the same status name when a dropdown status is chosen on any sheet and I want the entire row copied when a date is entered in another column on any sheet to the returns tab. Help svp!
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Intersect(Target, Range("S:S")) Is Nothing Then Exit Sub
On Error GoTo errhandler
If Target = "SCHEDULED" Then
Target.EntireRow.Copy Sheets("SCHEDULED").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target = "COMPLETED" Then
Target.EntireRow.Copy Sheets("COMPLETED").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target = "CANCELLED" Then
Target.EntireRow.Copy Sheets("CANCELLED").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target = "NOT SHIPPED" Then
Target.EntireRow.Copy Sheets("ACTION").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
End If
If Not Intersect(Target, Range("Q:Q")) Is Nothing Then
If Selection.Count > 1 Then Exit Sub
Dim Lastrow As Long
Lastrow = Sheets(5).Cells(Rows.Count, "A").End(xlUp).Row + 1
If IsDate(Target.Value) Then Rows(Target.Row).Copy Destination:=Sheets(5).Rows(Lastrow)
End If
Application.ScreenUpdating = True
errhandler:
Application.EnableEvents = True
End Sub
Checked a bunch of threads and am not able to get more than one intersect statement to run in my workbook. Each statement runs perfectly as seperate statements. I want an entire row to be move to a tab of the same status name when a dropdown status is chosen on any sheet and I want the entire row copied when a date is entered in another column on any sheet to the returns tab. Help svp!
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.ScreenUpdating = False
Application.EnableEvents = False
If Intersect(Target, Range("S:S")) Is Nothing Then Exit Sub
On Error GoTo errhandler
If Target = "SCHEDULED" Then
Target.EntireRow.Copy Sheets("SCHEDULED").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target = "COMPLETED" Then
Target.EntireRow.Copy Sheets("COMPLETED").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target = "CANCELLED" Then
Target.EntireRow.Copy Sheets("CANCELLED").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
ElseIf Target = "NOT SHIPPED" Then
Target.EntireRow.Copy Sheets("ACTION").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
Target.EntireRow.Delete
End If
If Not Intersect(Target, Range("Q:Q")) Is Nothing Then
If Selection.Count > 1 Then Exit Sub
Dim Lastrow As Long
Lastrow = Sheets(5).Cells(Rows.Count, "A").End(xlUp).Row + 1
If IsDate(Target.Value) Then Rows(Target.Row).Copy Destination:=Sheets(5).Rows(Lastrow)
End If
Application.ScreenUpdating = True
errhandler:
Application.EnableEvents = True
End Sub