I am attempting to create a code that copies a row to another sheet based on selections in columns G and F. I cannot figure out how to run both at once!
I am attempting to run this code:
Code
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "AG" Then
Target.EntireRow.Copy Sheets("AG").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "RF" Then
Target.EntireRow.Copy Sheets("RF").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "EH" Then
Target.EntireRow.Copy Sheets("EH").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "JH" Then
Target.EntireRow.Copy Sheets("JH").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "NL" Then
Target.EntireRow.Copy Sheets("NL").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "SP" Then
Target.EntireRow.Copy Sheets("SP").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "LS" Then
Target.EntireRow.Copy Sheets("LS").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "DS" Then
Target.EntireRow.Copy Sheets("DS").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub
If Target = "RW" Then
Target.EntireRow.Copy Sheets("RW").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
End Sub
Display More
--------------------------------------------------------------------------
At the same time as running the code below:
Code
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("F:F")) Is Nothing Then Exit Sub
If Target = "Clouded" Then
Target.EntireRow.Copy Sheets("Radi").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
If Intersect(Target, Range("F:F")) Is Nothing Then Exit Sub
If Target = "Faxed" Then
Target.EntireRow.Copy Sheets("Fax").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
End If
End Sub
----------------------------------------------------------------------------
How can I run both at the same time?