If certain 'type' is in col. K have whole row copy to new sheet [Solved/Closed]

Ask a question Dani - Last answered on Jun 21, 2016 at 08:54 AM by vcoolio

I am wondering if it is possible to have a whole row copy to a designated sheet based off of the value in a column. So for example if my row is A:P and the value in col. K = BIG, have that A:P copy to the sheet called BIG.


plus moins
Hello Dani,

The following code may do the task for you:-

Option Explicit
Sub TransferData()

Application.ScreenUpdating = False

        Dim ar As Variant
        Dim i As Integer
ar = Array("Big", "Little", "Medium")
  For i = 0 To UBound(ar)
         Sheet1.Range("K2", Sheet1.Range("K" & Sheet1.Rows.Count).End(xlUp)).AutoFilter 1, ar(i)
         [A2].CurrentRegion.Copy Sheets(ar(i)).Range("A" & Rows.Count).End(3)
    Next i
Application.CutCopyMode = False
Application.ScreenUpdating = True
MsgBox "Data transfer completed!", vbExclamation, "Status"

End Sub

It will find the criteria (in this case "Big", "Little", "Medium") in Column K of Sheet1 (which you could name "Master") and transfer the relevant row of data to each individual sheet. The criteria are in an array.

Following is the link to my test work book:-

Click on the button to run the code.

Let us know if its what you were thinking of.

I hope that this helps.

Was this answer helpful?  
plus moins
Hello Dani,

You have marked the thread as solved. Does it suit your needs?

For the sake of possible future visitors to this site/thread, please leave a reply of some sort confirming that it does suit your needs (or otherwise).

Thank you.


Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!