+ Reply to Thread
Results 1 to 10 of 10

Copy items where Col D has Fill colured items

  1. #1
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Copy items where Col D has Fill colured items

    I have fill colored items in Col D from row 2 onwards on sheet1. Where the values in Col D is in yellow, I need the rows from Col A to D copied and pasted using values on sheet2 (row 2 onwards) to A2 on sheet7



    I have tried to write code to do this, but get a syntax : Compile error



    Please Login or Register  to view this content.

    I have attached some sample data


    your assistance in resolving this is most appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: Copy items where Col D has Fill colured items

    From what I see in your code now, if any row has yellow, the whole range (not just that row) is copied. However, first part is that pastespecial needs to go on a separate line:

    Please Login or Register  to view this content.
    Then IF you only want to copy/pasted that row, you will need to add another variable, lets say "j" that is incremented each time you paste, so that the code knows where to place the next copy:
    At the start

    Dim j as Long
    j = 1
    Please Login or Register  to view this content.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Copy items where Col D has Fill colured items


    You mixed two codelines in one ! So just separate them …

    Edit : Arkadi was faster …

  4. #4
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Copy items where Col D has Fill colured items

    thanks for the help and input


    Code works perfectly

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,057

    Re: Copy items where Col D has Fill colured items

    @flupsie, glad I could help
    @Marc L.... maybe I wasn't faster, my post just arrived first because I'm in the same country as flupsie... lol!

  6. #6
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Copy items where Col D has Fill colured items

    I have tried to amend the code to copy the non-colored items to sheet3, but only the headings from sheet2 is copied


    Please check & amend

  7. #7
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Copy items where Col D has Fill colured items

    Will open a new thread as the original thread was solved

  8. #8
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Copy items where Col D has Fill colured items

    Hi Guys


    I would like the code below amended so as to copy the data after the last row where there is data in Col D on sheet7.

    Please Login or Register  to view this content.


    See full code below

    Please Login or Register  to view this content.

    your assistance in this regard is most appreciated

  9. #9
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Copy items where Col D has Fill colured items


  10. #10
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Copy items where Col D has Fill colured items

    See full code regarding solution




    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)

Similar Threads

  1. Replies: 2
    Last Post: 10-05-2017, 02:41 PM
  2. Data Validation - Selecting multiple items with ability to deselect items
    By dsklein85 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-12-2016, 09:02 AM
  3. Replies: 2
    Last Post: 08-13-2014, 09:48 AM
  4. [SOLVED] VBA copies rows based on specific items in a column but need to rename items created
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2013, 11:38 PM
  5. Identify Items, Sort those Items, Copy the Items
    By a1981stingray in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2010, 10:50 AM
  6. Replies: 1
    Last Post: 06-24-2005, 12:21 AM
  7. [SOLVED] Items in disabled items list - unknown excel addins causing probs
    By Rich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2005, 06:06 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