Copy and paste based on conditions

  • this may be far stretch but im wondering how(if) i could create a macro that will do the following,


    check cell for contents > copy contents > move to separate sheet > search for condition one (relative to original cell's location) > search for condition two (relative to original cell's contents) > find where x/y intersect and paste.


    This to my basic knowledge seems like the most direct way about it I figure i could use a long process of lookup and true/false, but with 645 cells to go through might take awhile to write/go through


    Id like a macro that will search each cell in the range E29:S50 on worksheet "Input" and if a cell is occupied it copies that cell moves to worksheet "Dats" then looks down column E to find the corresponding name from "input" worksheet and paste. Looking at the workbook may help make this make sense.


    Thanks in advance,

  • Unfortunately, I get a message that your workbook is corrupt so I can't open it. Perhaps you could try uploading it again.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • I downloaded it and it seemed to work just fine :o2.


    I may have figured out a way to go about this, well, maybe just an easier way?


    On worksheet "dats" starting down at E199 i have brought over the information from worksheet "Input" and with vlookup and if statement's compiled the data to contain what i need. i just need to figure out a macro that will, go through E256:E281, find cells not equal to 0, copy from column F to column T then return to the top of the page, find a match to the cell in column E and paste.

  • Is the location of the range E256:E281 static or can it change? If it can change, will it always be the last grouping on the sheet?

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • I currently have it set up so that on worksheet "Input" I take a horses name then i move over to a column im adjusting, add in a new date and continue until i have added all new information. On page Dats at the very top is where all this information is compiled,


    moving to worksheet "dats"
    range e200:T225 is a link to the same information i input on worksheet "input"


    range E228:T253 looks up the names found in E:200:E225 and pulls the previously entered information from the top of the page


    range E256:T281 compares the two ranges above substituting information from E:228:T253 with information from E200:T225


    range E328:T370 compiles the entire section of data at the top of the page with the new data mixed with old data in range E256:T281 which i can then use a simple copy, paste value macro to update the data at the top of the page.


    Im much better at formula's then macros so while this may seem like a huge run around to get to my goal it end's up with the same expected results

  • Are you saying that you no longer need a macro?

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Glad you got it all worked out. :)

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!