"delete" function

D

deb

I want to be able to delete an entire row, if a certain
cell within the row comes up with a certain value.

Example:
IF(B12="NA",DELETE12:12)

Is there a "delete" function or something that can do this?
Thanks!
 
J

Juan Sanchez

I can't think of a way to do it wit out code, but with
code is fairly easy:

right click on the sheet where you want this condition to
happen, click on view code, and paste this lines there:

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If UCase(Range("B12").Value) = "NA" Then Range
("b12").EntireRow.Delete
End Sub

This will delete the entire row 12 every time theres an NA
on B12...

Cheers,
Juan
 

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