View Single Post
 
Old 05-31-2016, 04:39 AM
jeffreybrown jeffreybrown is offline Windows Vista Office 2007
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

I don't have much time this morning, but a couple of things.

If you look at the code, I left a line in there to delete the row which was just moved.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim sname As String
    Dim rng As Range
    Set rng = Target.Parent.Range("I:I")
    If Target.Count > 1 Then Exit Sub
    If Intersect(Target, rng) Is Nothing Then Exit Sub
    sname = Range("I" & Target.Row).Value
    Target.EntireRow.Copy Worksheets(sname).Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
    Target.EntireRow.Delete
End Sub
Also, the reason for the example I choose column I is because A if the drop down is in A then the row would transfer before all the information is filled in.

Seems going from left-to-right would be the better way and then transfer info when you get to the end.

I feel I might be missing something so please fill in the gaps where I don't understand.
Reply With Quote