-
Delete Empty Rows
This is what I use to delete empty rows - is there a way I can get it to skip the first 3 rows - I really like this one as it is very quick. I suppose I could put a fony value in A1:A3 - then set them = vbnullstring after (but I really dont want to do so).
Code:
ActiveSheet.Columns(1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
-
Code:
Application.Intersect(ActiveSheet.Columns(1).Cells(4).Resize(Rows.Count - 4 + 1), ActiveSheet.Columns(1).SpecialCells(xlCellTypeBlanks)).EntireRow.Delete
-
This would be more elegant though
Code:
ActiveSheet.Cells(4, 1).Resize(Rows.Count - 4 + 1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
-
By the way, why do you want to delete the entire range all the way to the last row in the sheet? Shouldn't you be using a more dynamic one based on the last filled cell of the column?
Like
Code:
With ActiveSheet
.Range(.Cells(4, 1), .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, 1)).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
-
My column A is a position column - so it always have a value - if the record is valid. So your answer is perfect - tyvm