Deleting Blank Rows Subject to Criteria

G

Guest

I wanted to delete blank rows using the following:

Public Sub DeleteRowOnCell(
On Error Resume Nex
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delet
ActiveSheet.UsedRang
End Su

But I wanted instead of to check for an empty cell (as the above does?) to see if the following formula returned "" and delete the row if it did and to leave it if it didnt

=IF(ISERROR(VLOOKUP(B1,Sheet2!A1:A10,1,FALSE))=TRUE,"","1"

If anyone can help i'd sure appreciate it

Thanks in advanc

Mark
 
M

Muppet

modified the formula a bit
=IF(ISERROR(VLOOKUP(B1,Sheet2!A1:A10,1,FALSE)),FALSE,"")

then the vba a bit
Selection.SpecialCells(xlCellTypeFormulas, xlLogical).EntireRow.Delete


Mark said:
I wanted to delete blank rows using the following:-

Public Sub DeleteRowOnCell()
On Error Resume Next
Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
ActiveSheet.UsedRange
End Sub

But I wanted instead of to check for an empty cell (as the above does?) to
see if the following formula returned "" and delete the row if it did and to
leave it if it didnt.
 

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