=====================================================
Sub deleterow()
Sheet4.Activate 'activate sheet4
Sheet4.Columns("A:A").Select 'select range for column A
'this below command will search the word "my name " in columnA
Selection.Find(What:="my name", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Activate
ActiveCell.Select
'this command will set the range 1 cell above the word "my name " if found till cell A1
Range(ActiveCell.Offset(-1, 0), "A1").Select
'this command will delete the selected range
Selection.Delete (xlUp)
end sub()
=====================================================
No comments:
Post a Comment