LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
Posts: 27,285
Default Better way to delete rows wiht #N/A?

If you don't want to delete the header row as Don proposes

On Error resume Next
Sheets("HotList").range("bj14:bj3000").SpecialCell s(xlFormulas,xlErrors).Delete
On Error goto 0

Would be another way.

if the #N/A is not produced by a formula, then change xlFormulas to

Tom Ogilvy
"SteveC" wrote in message
I use the following macro obtained from someone on the board to delete all
rows that contain #N/A in a particular column... problem is that it seems
really slow... wondering if there is a faster way? Thanks for taking a
look... SteveC

Sub Delete_Rows_With_Error_Russell_Adjust()
Dim DeleteValue As String
Dim rng As Range

DeleteValue = "#N/A"
With ActiveSheet
.Range("BJ13:BJ3000").AutoFilter Field:=1, Criteria1:=DeleteValue
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete

End With
.AutoFilterMode = False
End With
End Sub

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm a leaner wiht a headache!! Gary''s Student Excel Worksheet Functions 0 September 11th 09 05:44 PM
Better way to delete rows wiht #N/A? Don Guillett Excel Programming 0 January 19th 07 10:45 PM
Need help wiht a macro for autofill rows klafert Excel Worksheet Functions 9 September 10th 06 07:47 PM
sum wiht an if or vlookup? Chip Smith Excel Discussion (Misc queries) 1 March 31st 06 07:11 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM

All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.

About Us

"It's about Microsoft Excel"