How to loop worksheet columns and delete shift-up when three adjacent cells are empty

  • I am looping through a folder and copying three columns from each file to a single sheet in a single workbook. What I'd like to do is delete and shift up any range of three adjacent cells that are blank within each three column grouping.

    For example, in the attached image I would need to delete A5:C5, A7:C9, E5:G7 and I4:KI4, among others. I cannot delete rows because no row will be completely blank due to the number of columns I will have once all columns have been copied into the sheet.

    I'd really appreciate any help you can give me. Thanks!

  • As long as your empty cells don't contain formulas, have a try with this macro on your active sheet. Change last row detection method if your real sheet has other areas compiled.

    Edited 3 times, last by rollis13 ().

Participate now!

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