View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
NoodNutt NoodNutt is offline
external usenet poster
 
Posts: 221
Default deleting rows based on criteria

try this

Although not tested.

Sub Remove_Foreign()

Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
End With

With Sheets("yoursheet")
.Select
Firstrow = yourfirstrow
Lastrow = yourlastrow

For Lrow = Lastrow To Firstrow Step -1

With .Cells(Lrow, "A")

If Not IsError(.Value) Then

If .Value = "*"&"QMS"&"*" Then .EntireRow.ClearContents

End If

End With

Next Lrow

End With

With Application
CalcMode = .Calculation
.Calculation = xlAutomatic
End With

End Sub

HTH
Mark.