I\'m trying to run a macro that selects blank cells in a table column and deletes the entire row.
The script below does everything except the deleting part, which p
Two notes regarding Frej Lindstrom's solution, which I used but had to tweak a little:
(1) add an End If before the Next
(2) add "i = i - 1" just before the End If
Why?
because if you have blank rows one above each other, you'll skip one since all the rows' numbers just shifted one up. Essentially, if you deleted row [N]
, another row is now row [N]
, and you need to also test it rather than moving immediately to row [N + 1]
.
BIG CAVEAT: if your last row is blank, this will give you a stuck loop. I'll probably put in an IF to handle it, though.
I know this is an old thread, but thought I'd add this in case anyone else comes through looking for similar solutions. Thank you to Frej - your code really helped!