thefordness
New Member
- Joined
- Oct 23, 2013
- Messages
- 7
I need a code to run through cells in a named range and remove the blank rows. I have one named range that actually refers to several smaller named ranges on separate parts of a sheet. Ideas?
How non-contiguous are the smaller ranges. I'm thinking that if you delete a bunch of rows in the overall range, it will compress the smaller ranges and could cause some overlap of the named ranges as the rows shift to replace the deleted ones Or maybe not, need to think on this a while.I need a code to run through cells in a named range and remove the blank rows. I have one named range that actually refers to several smaller named ranges on separate parts of a sheet. Ideas?
How non-contiguous are the smaller ranges. I'm thinking that if you delete a bunch of rows in the overall range, it will compress the smaller ranges and could cause some overlap of the named ranges as the rows shift to replace the deleted ones Or maybe not, need to think on this a while.
Sub doblanks()
For i = 41 To 2 Step -1
If Cells(i, 2) = "" Then
Rows(i).Delete
End If
Next
End Sub