Referencing Rows to delete blank Rows
Referencing Rows to delete blank Rows
(OP)
I want to delete blanks row in a file that I am reading in so I check for blank cells. I then try to slect the row by the row number. this is where it hangs up.
CURRENT_ROW = 7
Rows("CURRENT_ROW:CURRENT_ROW").Select <= hangs up
because I know that
Rows("7:7").select
works
any help would be great thanks
CURRENT_ROW = 7
Rows("CURRENT_ROW:CURRENT_ROW").Select <= hangs up
because I know that
Rows("7:7").select
works
any help would be great thanks





RE: Referencing Rows to delete blank Rows
Try this line
rows(current_rows).delete
Hope this helps!
maybe only a drafter
but the best user at this company!
RE: Referencing Rows to delete blank Rows
Sub DeleteEmptyRows()
LastRow = ActiveSheet.UsedRange.column - 1 + ActiveSheet.UsedRange.Rows.Count
For r = LastRow To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then Rows(r).Delete
Next R
End Sub
RE: Referencing Rows to delete blank Rows
I'm just looking back over my threads for filing purposes and just found a better way to do this. I know it's a couple of months later but someone may find this useful.
Sub Macro1()
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
Hope this helps.
----------------------------------
maybe only a drafter
but the best user at this company!