+ Reply to Thread
Results 1 to 15 of 15

Copy color filter column other sheet

  1. #1
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Copy color filter column other sheet

    Good morning,
    * In the attached file by clicking on the "compare columns" button
    It compares the same values between two columns chosen by me and colors them in yellow.
    So far all right, now I would like to be able to filter by color and copy the results to another sheet.
    What I want to get is seen in sheet1
    Thank you
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy color filter column other sheet

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Copy color filter column other sheet

    Hi Alansidman
    Meanwhile I thank you for the code you sent me.
    If the color was always in column J works correctly but, the color of the columns can vary from H to N (in the attached sample file).
    As mentioned above, clicking on the "compare columns" button I choose 2 columns to compare the same values and, it is not always the column J but it can range from H to N.
    I hope I'm better explained
    Thanks again.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy color filter column other sheet

    In that case, change the range that c searches. ie.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Copy color filter column other sheet

    Sorry, a little mistake yet.
    She copies me the rows 2 times.
    I selected column 8 and column 9
    Should only copy line 25
    But as you can see in sheet1, it shows it twice.
    So also with other columns.
    Attached Files Attached Files

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy color filter column other sheet

    Yup. You are right. It happens because c finds the interior color index twice. Once in column H and again in Column I. Need to relook at how it searches as we have given it a range of H:N columns. A question, would it be acceptable to ask via an input box which column to search? Would that work for you?

  7. #7
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Copy color filter column other sheet

    If you can not do it anyway, do the same with the imput box.

    But, can not you say that if a row from column H to column N finds a colored cell then copy line?

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy color filter column other sheet

    That is what is happening now, but it copies twice because it finds two cells colored on a line.

    Try this as I think this will deliver what you want.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Copy color filter column other sheet

    Perfect Alan, now works thanks
    If for you is not a problem, how can I change the next macro that instead of asking No. column asks for column letter?

    Please Login or Register  to view this content.

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy color filter column other sheet

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Instead of the Cells Object which uses the syntax Cell(rownumber, column number)
    Use the Range Object which uses syntax Range(FirstCell:SecondCell) syntax.

    Or use the cells object with syntax cell(rownumber, column letter surrounded by quotes)

  11. #11
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Copy color filter column other sheet

    Sorry Alan,
    Making the corrections you've made me mistaken
    On the line:
    Set pippo = zona.Cells (1, Val (Campo))


    Please Login or Register  to view this content.
    Last edited by Berna11; 06-25-2017 at 05:35 PM.

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy color filter column other sheet

    change to
    Please Login or Register  to view this content.
    as Campo is now a string

    make similar changes to code further along.

  13. #13
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Copy color filter column other sheet

    Hi Alan,
    I still ask you to apologize but, I'm not very experienced and translation does not help me.
    I inserted the variation:
    Please Login or Register  to view this content.
    Then I took off the rows below:

    Please Login or Register  to view this content.
    in:



    Please Login or Register  to view this content.
    But continues to make mistakes in:

    Please Login or Register  to view this content.
    Thanks again for the interest

  14. #14
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,879

    Re: Copy color filter column other sheet

    I've gone back and analyzed your original code and because you are subtracting column numbers from other column numbers, you probably need to keep the code as originally shown. You cannot subtract column letters from other column letters. You will be better served to stay with the original code using column numbers. I apologize for now seeing this sooner as I was responding to general questions and did not really look at the entire code. Your original code works. Stay with it as it is not broken.

    Alan

  15. #15
    Forum Contributor
    Join Date
    05-16-2012
    Location
    Latina, ITALY
    MS-Off Ver
    Excel 2010--2016
    Posts
    947

    Re: Copy color filter column other sheet

    Well Alan
    thank you very much for your interest.
    I'll have my original coice.
    Thanks again for your precious help
    A greeting to the next.

+ 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. Filter range and copy selected column visible data and paste other sheet
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-19-2017, 11:37 AM
  2. [SOLVED] Copy specific column data from one sheet to another sheet using Certain filter Criteria
    By xlhelp7 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2017, 12:09 AM
  3. Filter column by text and copy to another sheet
    By Grens in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2016, 10:05 AM
  4. VBA Multi-Column Filter, Copy and Paste on Separate Sheet
    By AMJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-22-2014, 06:33 AM
  5. [SOLVED] Copy cells in another sheet if 1st sheet has a certain color in a specific column
    By ccellarius32 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-02-2014, 05:08 PM
  6. [SOLVED] vba help needed to filter data then copy to another sheet by matching column header
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-13-2014, 01:52 PM
  7. Macro to filter based on column heading then copy and paste to new sheet
    By macattackr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2012, 05:14 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