This is how it is done. We make use of macros to achieve this.
- If the developer tab is not visible make it visible as follows: (MS Excel 2007)
- Click the office button
- Then, click the Excel Options button
- Choose "Popular" tab
- In "Top option for working with Excel", tick the "Show developer tab in the Ribbon"
- Now go to the developer tab and click on the visual basic button.
- Double click on the sheet1(sheet1)...or the sheet you want the macro to run
- Now enter this code:
- Replace MyString with the string you want to search
Sub DoIt()
Dim Sentences
Dim i As Long
Dim iWordPos As Integer
Sentences = Range("A1", Range("A65536").End(xlUp))
lRow = 0
For i = Range("A65536").End(xlUp).Row To 1 Step -1
iWordPos = InStr(LCase(Sentences(i, 1)), LCase("MyString"))
If iWordPos > 0 Then
Range("A" & i).EntireRow.Delete shift:=xlShiftUp
End If
Next i
End Sub
'Comment : Range("A65536").End(xlUp) is the final cell
No comments:
Post a Comment