squidmark
Board Regular
- Joined
- Aug 1, 2007
- Messages
- 105
I get spreadsheets where previous users "cleared" a cell by using the spacebar. Now, I need some code that will look at all of column G and delete the rows where the cell in column G is blank. But sometimes the "blank" cell is really a space, so it just looks blank.
I've used this:
columns("G").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
to delete the rows that are actually blank. Which is how I realized many aren't actually blank.
Is there a way to just say if len(g1)<2, delete whole row, but have it look at the entire column all at once as the code above does, rather than using something like a for-next loop that will take more time to run?
Yes, I'm a VBA noobie.
Thanks.
I've used this:
columns("G").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
to delete the rows that are actually blank. Which is how I realized many aren't actually blank.
Is there a way to just say if len(g1)<2, delete whole row, but have it look at the entire column all at once as the code above does, rather than using something like a for-next loop that will take more time to run?
Yes, I'm a VBA noobie.
Thanks.