Delete Rows

S

STEVEB

Hi All,

I was wondering if anyone could help me with a simple Macro code for
Excel 97 for deleting rows. After I do I VLOOKUP, I would like a MACRO
to automatically delete all rows that come back as "#N/A". Does anyone
have any suggestions?

Thanks
 
T

Tom Ogilvy

Assume your formulas are in column C

Dim rng as Range
On Error Resume Next
set rng = Columns(3).SpecialCells(xlFormulas,xlErrors)
On Error goto 0
if not rng is nothing then
rng.Entirerow.Delete
End if
 

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