+ Reply to Thread
Results 1 to 6 of 6

Loop to copy all rows containing specific values

  1. #1
    Registered User
    Join Date
    09-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Loop to copy all rows containing specific values

    Hi all

    First post, excuse me if a goof it up.

    I have a table of data that goes from columns C to Q. The data starts in C9 and the Q range will vary. It is a table of invoice data, with the Director's name being in column J. It is sorted by column J. I need to copy all the rows (columns C:Q only) that contain a given director's name in to the relevant worksheet which will also have that name. The worksheets all already exist, and the data only ever needs to be pasted (values only) to cell C9, as long as it goes as a group.

    I hope this makes sense, I have trawled many forums and can't figure out how to make any of them work. If anyone could help I would be most grateful.

    I will not post any of the code that I have tried as nothing works at all close to what I need.

    Thanks very much in advance.

    WW

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Loop to copy all rows containing specific values

    you should upload a workbook with a before and after situation or at least a sample workbook that looks like the workbook you're working in

  3. #3
    Registered User
    Join Date
    09-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Loop to copy all rows containing specific values

    OK thanks I didn't know to do that.

    Attached is a sample book with the source table and four output tabs.

    Cheers
    W
    Attached Files Attached Files

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Loop to copy all rows containing specific values

    maybe something like this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Loop to copy all rows containing specific values

    Hi nilem

    Thank you, that worked perfectly for the sample data.

    For my actual data I only need to copy what is in columns C:Q and paste them to columns C:Q on the corresponding sheet (starting at row 9). I can't figure out how to alter your code to get it to work, sorry.

    Any help again much appreciated.

    Cheers
    W

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Loop to copy all rows containing specific values

    maybe so
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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