+ Reply to Thread
Results 1 to 2 of 2

Macro to copy rows based on background color of cells within a range of columns

Hybrid View

  1. #1
    Registered User
    Join Date
    11-20-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2013
    Posts
    2

    Macro to copy rows based on background color of cells within a range of columns

    First I want to thank everyone in the forums for taking the time to help out others!!

    After quite exhaustive searching this macro is the closest to what I need, so I thought I would ask for a little help.

    I ran this macro but haven't figured out how to get the final touches on it.
    A little background. I have an inventory with multiple worksheets, but not every worksheet needs to have rows copied. I am collecting all missing items on it's own worksheet. Missing items are highlighted red using a dropdown box with conditional formatting in a "status" column.

    So what I need:
    I need to specify multiple worksheets to search (ex. names SN06210, SN06255, etc)
    I need to specify which worksheet to paste the data (Discrepancies)


    And just as a question about macros in general- Will it update as people make changes or do I need to manually run the macro every time?

    Here's a sample file.
    Attachment 279328

    Thank you so much!!
    Attached Files Attached Files
    Last edited by jpitt916; 11-21-2013 at 06:02 PM. Reason: Moved to own thread as per forum rules. Do not hijack threads with new questions, post your own threads. Thanks.

  2. #2
    Registered User
    Join Date
    11-20-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Macro to copy rows based on background color of cells within a range of columns

    Oh boy. Well now that I added the dropdown with conditional formatting the macro doesn't work anymore.

    I think this might work, but I need it to say the equivalent of

    WITH Application.Find
    Clear
    Interior.Characters = Missing

    But obviously, that's not the way to write it. LOL


    Sub test()
        Dim r As Range, ff As String, x As Range
        With Application.FindFormat
            .Clear
            .Interior.Color = 255
        End With
        With Sheets("SN06209").Columns(9)
            Set r = .Find("*", searchformat:=True)
            If Not r Is Nothing Then
                ff = r.Address: Set x = r
                Do
                    Set x = Union(x, r)
                    Set r = .Find("*", r, searchformat:=True)
                Loop Until ff = r.Address
                x.EntireRow.Copy Sheets("Discrepancies").Cells(1)
            End If
        End With
    End Sub
    Last edited by jpitt916; 11-22-2013 at 03:55 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to copy rows based on background color of cells within a range of columns
    By Chrispelletier in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-19-2013, 01:30 PM
  2. [SOLVED] Color Index to sum up cells based on background color
    By jph89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2013, 03:23 PM
  3. [SOLVED] Macro to change all cells with a certain background color in another background color
    By kevinvzandvoort in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2012, 11:04 AM
  4. Replies: 3
    Last Post: 05-02-2012, 09:08 AM
  5. Copy same rows based on red color cells
    By unley in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-21-2011, 05:45 PM

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