+ Reply to Thread
Results 1 to 2 of 2

Conditional Copy Macro Help Needed

  1. #1

    Conditional Copy Macro Help Needed

    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


  2. #2
    Otto Moehrbach
    Guest

    Re: Conditional Copy Macro Help Needed

    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
    <[email protected]> wrote in message
    news:[email protected]...
    >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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1