View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gordon[_2_] Gordon[_2_] is offline
external usenet poster
 
Posts: 211
Default Delete Rows then Move Up

Hi...

The procedure stops on this line: Run-time error 13 Type mismatch

If MyCell.Value = "#N/A" Then

Any clues?

Thanks in advance...

Gordon...



" wrote:

In the Worksheet module:


Sub Delete_NA()
Dim MyCell As Range
For Each MyCell In Range("B1:B3000")
If MyCell.Value = "N/A#" Then
MyCell.EntireRow.Delete
End If
Next
End Sub

Gordon wrote:
Hi...

I have 3000 records. In column B there are sporadic #N/A values. I need some
nicely packaged code that will delete all rows where a #N/A appears in B, so
that there are no gaps in the rows. Sounds easy but I'm struggling.

Any help would be most appreciated.

Thanks

Gordon...