Copy Non-Blank rows in a Range and Paste

  • Thanks so much for sticking with me Carim!

    Now it looks like if either column V or Y is blank, the row will not be copied. My hope was that it would only skip the ones that are blank in row Y.

    In the sheet below, I deleted the contents of cell V223 and cell Y224 so I could see which column was being referenced.


    Test edit29 - ozg.xlsm

  • Good to hear some progress has been made ...:)


    The current macro only checks the cells in Column Y ....


    For example, now that you have deleted the contents of cell Y224 ... the whole row is excluded from the process ...


    Isn' t what you had requested ...???


    If Not ... What should be the role of Column V ...???

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Thanks again Carim and sorry I am not adequately describing the symptoms. The row is being excluded if column Y is blank which is great but rows are also being excluded if only column V is blank. I removed the contents of V223. Y223 still has data in it but row 223 is not being copied.

    Test edit29 - ozg.xlsm

  • PERFECT!!! Thanks so much Carim!!


    You have done so much that I hate to ask just out of curiosity but the only change I see between the last two versions of code were the column reference in this line:

    LstRw = Cells(Rows.Count, "F").End(xlUp).Row + 1

    But it doesn't seem like that line is intended to impact the inclusion/exclusion criteria. I totally understand if you want to move on with your life but would be interested in learning how each line is impacting the results.


    Either way, thanks again!!!


    Posting working code here for posterity:

  • Glad to hear ... there is finally a relief ... :)


    Let's dive a few seconds into the underlying logic ...


    In terms of Columns : your Source Range is 11 Columns wide from V to AF ... but you are using Column Y as your Reference or the Fourth Column ...


    When it comes to your Destination Range which starts in Column C till Column M to cover the 11 Columns required, the Column to be used to identify the Last Row has to be ( like the Source one ) the Fourth Column ...i.e. Column F ...


    Hope this clarifies

    :)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • Thanks again for your Thanks ...AND for the Like :thumbup:


    May be a small piece of advice for your future Excel workbooks ;)


    Do not try to combine in one single sheet ...BOTH your Input data AND your Output report


    Since you might create for yourself 'future' difficult obstacles ...:S


    Simplest solution is : to keep your data in a dedicated sheet , and build your output in another dedicated sheet ...:)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

  • You are very welcome !!!:):):)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Smiley" icon, below, in the bottom right corner :)

Participate now!

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