delete rows in a given range

W

Wen

Anyone has a good sub to delete from a given range any row with blank index
cell?
For example, I have a table range with column A titled "Name" as index
column. I need a sub that deletes any row where column A is blank, but say,
column C has non-blank value. it is not the same as deleting all blank rows
in a range.
TIA.
Wen
 
F

fisch4bill

In order for this code to work for me, I had to change the line:

lngLastRow = wks.Cells(Rows.Count, "A").End(xlUp).End

to:

lngLastRow = wks.Cells(Rows.Count, "A").End(xlUp).Row

Using the original line resulted in Run-time error '450': "Wrong number of
arguments or invalid property assignment"

Otherwise, once I changed the reference to the value I was testing for it
worked flawlessly and the logic was just what I needed.

Thanks Ryan.
 

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