+ Reply to Thread
Results 1 to 11 of 11

Transfer Rows with specific color from Multiple Sheets onto one sheet

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Transfer Rows with specific color from Multiple Sheets onto one sheet

    I have about 15 sheets in a workbook. Each sheet contains large volumes of data. Some of the rows are conditionally colored yellow based on the certain criteria of a cell in each row. I need a short macro that will copy all the yellow colored rows in each of the 15 sheets into a single sheet.

    Plainly put, I don't know how to use an AutoFilter function to search for criteria based on color rather than text

    TIA

    CJ

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    Do you have a sample file that you can upload?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    09-20-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Post Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    I do have the file but it contains a ton of confidential information. I work for a biotech company and all of the data is DNA seqeuences. The file im uploading doesnt have any of the sequences but it contains the name for each sequence and the rows that I wish to move are still colored yellow.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-20-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    For your reference, I'm trying to copy any yellow row in any of the sheets named "Tag " - "Tag 15" into the last sheet named "MisTagged"

    Thanks!

    CJ

  5. #5
    Registered User
    Join Date
    08-15-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    See the attached workbook. I'm pretty close. I can get the first highlighted row in the first worksheet the code encounters to copy over.

    There is a problem somewhere with the looping.

    Perhaps a fresh set of eyes will be able to help.

    The code runs fine the way it is. There are no error messages so I'm not sure where the code it going wrong.
    Attached Files Attached Files

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    Do you need the sheet name from where the row was copied?

    Also - just a pointer - in sheet Tag12, i did see many rows that were colored yellow only from column P onwards. Maybe thats a typo.

  7. #7
    Registered User
    Join Date
    08-15-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    Sheet Tag12 is why I am trying to have my code loop through each cell in the row. Basically what I was going for was for the code to start in the first cell of the first row, loop through all cells in that row until the end and if any cell was highlighted then copy that row to MisTagged.

    Once one highlighted cell was encountered in a row I wanted to have the code quit searching that row (because it has already been copied) and jump to the next row. I wanted the code to do this until the last row on the sheet and then go to the next sheet and do the same thing.

    I can get one row to copy and then the code quits. No error though.

    Any thoughts?

    Adding the sheet name should be easy enough if the original poster needs it once the rest of the code works.

  8. #8
    Registered User
    Join Date
    09-20-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    No need, the sheet name from where it came is irrelevant. All I need is just all the information in the row.

    Thanks again!

  9. #9
    Registered User
    Join Date
    09-20-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    And yes that is a typo. The whole row should be yellow.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    Try this code
    Please Login or Register  to view this content.
    Put it in a standard module and then you can assign it to a command button or a shortcut key combination.

  11. #11
    Registered User
    Join Date
    09-20-2012
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Transfer Rows with specific color from Multiple Sheets onto one sheet

    Worked perfectly, thank you!

+ 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