View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
darkblue darkblue is offline
external usenet poster
 
Posts: 35
Default Two column deletion


How can i put these 2 sub into 1 ?
Currently to speed up deletion i sort accordingly like

Sort by column(12)
Run DelPost
Sort by column(11)
Run DelPre.
---------------------------------

Sub DelPost()
On Error Resume Next
With ActiveSheet.Columns(12)
.ColumnWidth = 20
.Replace _
What:="Post", _
Replacement:="#N/A", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
.SpecialCells(xlConstants, xlErrors).EntireRow.Delete
End With
End Sub

Sub DelPre()
On Error Resume Next
With ActiveSheet.Columns(11)
.Replace _
What:="Pre", _
Replacement:="#N/A", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
.SpecialCells(xlConstants, xlErrors).EntireRow.Delete
End With
End Sub

Thank you in advance.