View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
capt capt is offline
external usenet poster
 
Posts: 67
Default VLookup with criteria and delete row

Thank you FSt1.
Just the job. it works great.
--
capt


"FSt1" wrote:

hi
and another line of logic.
Sub findDelete()
Dim c As String
Dim Rng As Range
c = InputBox("Enter string to delete.")
Set Rng = Nothing
Set Rng = Range("A:A").Find(what:=c, _
After:=Range("A1"), _
LookIn:=xlFormulas, _
lookat:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
'Rng.Select 'optional
Rng.EntireRow.Delete shift:=xlUp
End Sub

regards
FSt1

"capt" wrote:

What is the best code to use to look for a name ( col A) and delete the whole
row.
--
capt