script does not delete blank rows

G

Guest

When I run this script from either the workbook where the worksheet is
located or from my personal.xls workbook it does not delete the rows that
have blank cells in column ("M"). It doesn't seem to do anything. It
compiles but it doesn't run. I still have all the rows with blank cells in
column "M" which are not needed for this report.

thanks,


Sub DeleteRows()
With ActiveSheet
On Error Resume Next
Columns("M").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0
End With
End Sub
 
G

Guest

Janis,

It seems like you missed a "."


So, replace this line

Columns("M").SpecialCells(xlCellTypeBlanks).EntireRow.Delete

With this

.Columns("M").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top