Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing Rows to delete blank Rows 1

Status
Not open for further replies.

mmartens

Mechanical
Jul 17, 2001
24
CA
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(&quot;CURRENT_ROW:CURRENT_ROW&quot;).Select <= hangs up

because I know that

Rows(&quot;7:7&quot;).select

works

any help would be great thanks



 
Replies continue below

Recommended for you

Hello,

Try this line

rows(current_rows).delete

Hope this helps!

maybe only a drafter
but the best user at this company!
 
You can also try this to delete all the empty rows in the used portion of a spreadsheet.

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
 
Hello,

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(&quot;A:A&quot;).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub

Hope this helps.

----------------------------------

maybe only a drafter
but the best user at this company!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top