View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Two column deletion

darkblue used his keyboard to write :
Maybe it is my poor english Garry, sorry.
What i mean is below code works even if
row2, for instance, has two "#N/A" on col1 and col2.
Although i use your original code because of the sorting before
deletion.
Regards

Sub Delete_PreAndPost()
On Error Resume Next
With ActiveSheet.Range(ActiveSheet.Columns(1).Address). Resize(, 2)
.Replace What:="Pre", Replacement:="#N/A", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
.Replace What:="Post", Replacement:="#N/A", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
.Range("A:B").SpecialCells(xlConstants, xlErrors).EntireRow.Delete
End With
End Sub


Well, you're right! I'm afraid I misunderstood something here but now I
see what Rick was doing. (I should have known better than to Q Rick's
intent)

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc