• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy rows to new sheet if any column meets criteria

alan steier

New Member
I'm new at VBA and struggling to create a macro that will copy all rows (to a new worksheet) when ANY of 6 different columns within the row meet a certain condition. The range will always be A4:BP (worksheets will vary in # of rows). Within columns AB-AG I would like to check if ANY of the cells have a value greater than 350 - if so, copy row to new sheet.

Any help would be greatly appreciated!!
 
Record yourself performing these steps to gets the basic structure, then work on trimming it down (or, post the recorded macro here and we can help).
  1. Create a helper column with this formula:
  2. =MAX(AB2:AG2)>350
  3. Apply Autofilter to helper column, filtered on TRUE.
  4. Copy results to new sheet.
  5. Turn off AutoFilter
  6. Delete helper column
 
Record yourself performing these steps to gets the basic structure, then work on trimming it down (or, post the recorded macro here and we can help).
  1. Create a helper column with this formula:
  2. =MAX(AB2:AG2)>350
  3. Apply Autofilter to helper column, filtered on TRUE.
  4. Copy results to new sheet.
  5. Turn off AutoFilter
  6. Delete helper column
Thanks Luke! Creating the helper column did the trick. Appreciate the help!
 
Back
Top