I run a warehouse and we are getting ready to ramp up the volume of orders we receive from our customer. I want the sheet to cut the entire row and paste it into the next sheet anytime the dropdown box in column "I" is changed to yes.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr As Long
Dim cust As String
' Exit if more than one cell updated
If Target.CountLarge > 1 Then Exit Sub
' Check to see if column is H (8th column) and value is "Yes"
If (Target.Column = 8) And (Target.Value = "Yes") Then
' Get customer name to know which sheet to apply to
cust = Cells(Target.Row, "A").End(xlUp).Value
' Find first blank row on new sheet
lr = Sheets(cust).Cells(Rows.Count, "A").End(xlUp).Row + 1
' Copy to new sheet
Application.EnableEvents = False
Rows(Target.Row).Copy Sheets(cust).Cells(lr, "A")
' Delete old row
Rows(Target.Row).Delete
' Reenable events
Application.EnableEvents = True
End If
End Sub
' Check to see if column is H (8th column) and value is "Yes"
If (Target.Column = 8) And (Target.Value = "Yes") Then
' Check to see if column is I (9th column) and value is "Yes"
If (Target.Column = 9) And (Target.Value = "Yes") Then