delete row?

V

Vince

need some help on this one.

Is there a way to check to see if there is a value or not null for three
cells in a row and if there is not, then delete the row?

Example:

I have sheets of customer information where each row is a different customer
(name, address, ect..), but if they do not have a contact number (home,
work, cell) i would like to delete them.

I'm pretty sure that this can be done via macro, but don't know how. Any and
all help is greatly appreciated!

Thanks
Vince
 
R

Ron de Bruin

Try this

This will check the first 10 rows on the active worksheet and
check if there are values in A:C

Change to your situation

Sub test()
Dim a As Long
For a = 10 To 1 Step -1
With Application.WorksheetFunction
If .CountA(Range("A" & a & ":C" & a)) = 0 Then
Rows(a).Delete
End If
End With
Next a
End Sub
 

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