Select and Export All Rows Between Two Different Cell Names, Loop

  • Hi,


    I am working with datasets that have many thousands of rows. I am looking to select the rows including and between the start and end of a given condition (Nominal cell values) and export only those rows of interest to a new sheet.


    The condition may start and end several times with other unimportant rows between the end of the previous condition and the start of the next same condition, so I seek to loop the operation down the current active sheet.


    The conditions are located in the 'W' column and my excel sheets generally contain about 63,000 rows each.


    I have a working code which I provide below, but I keep getting errors on the basis of 'For without Next'. I am wondering if anyone may have insight as to what is wrong with my code.



    Thank you for your help!

  • You have a "With" statement that has not been closed with an "End With" also a "For" statement that has not been closed with "Next"

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

Participate now!

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