Conditional Copy Macro Help Needed

I

ipsy9

I need a macro that copies rows only if certain text is in column A

For example if Cell "A5" is Evan Jones, then Cells B5-J5 will get
copied to the sheet named "Evan Jones", and if another cell in column A
also says Evan Jones then the same applies for its row except it will
be put in the next row of "Evan Jones" sheet.
I have several names that this will be working with in "Column A" which
is titled "Customer Name", and each line will have information in
columns B-J for those rows....
I hope you understand what I mean, and I hope someone can help....

Thanks
 
O

Otto Moehrbach

The following macro might work for you.
I assume that a sheet exists for every name that is in Column A, starting
with A2. An error will result if this is not the case. HTH Otto
Sub CopyData()
Dim RngColA As Range
Dim i As Range
Application.ScreenUpdating = False
Set RngColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
For Each i In RngColA
With Sheets(i.Value)
Range(Cells(i.Row, 2), Cells(i.Row, 10)).Copy
.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial
End With
Next i
Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top