Excel VBA delete row if contains certain strings (edit)

https://excel.officetuts.net/en/vba/delete-a-row-if-cell-contains

https://analysistabs.com/vba/delete-row-if-cell-contains-string-excel-macro-example-code/

https://stackoverflow.com/questions/26683163/excel-vba-delete-row-if-contains-certain-strings-or-has-a-delete-flag-set

What is VBA?

The acronym VBA stands for Visual Basic for Applications. It is an integration of the Visual Basic with Microsoft Office applications (MS Excel, MS PowerPoint, MS Access, MS Word and MS Outlook). By running VBA within the Microsoft Office applications, you can automate repetitive tasks.

Getting Started With VBA

https://www.guru99.com/creating-your-first-visual-basic-for-applications-vba-in-excel.html

https://riptutorial.com/excel-vba

https://www.listendata.com/2014/05/excel-macro-beginner-tutorial-make-your.html

https://www.i-programmer.info/ebooks/automating-excel/1264-getting-started.html

Getting Started With VBA Automation

https://spreadsheet1.com/getting-started-with-vba.html

open Visual Basic Editor

Open The Visual Basic Editor

You can open the Visual Basic Editor (VBE) using the ALT-F11 shortcut or from the Developer Tab, click 'Visual Basic'

https://www.thespreadsheetguru.com/

https://www.ozgrid.com/forum/

http://excelexperts.com/forum

http://excelexperts.com/Free-Excel-Training-Videos

What are excel macros?

https://www.listendata.com/2014/05/excel-macro-beginner-tutorial-make-your.html

5 Different Ways to Find The Last Row or Last Column Using VBA

https://www.thespreadsheetguru.com/blog/2014/7/7/5-different-ways-to-find-the-last-row-or-last-column-using-vba

Copy & Paste Multiple Excel Ranges To Separate PowerPoint Slides With VBA

https://www.thespreadsheetguru.com/blog/2014/6/30/copy-paste-multiple-excel-ranges-to-separate-powerpoint-slides-with-vba

Code Sample

Giả sử cột A có những Row chứa chuỗi cần Delete cả dòng đó, ta thực hiện như sau:

  1. Press Alt + F11
  2. Go to menu Insert > Module
  3. Paste the following code
  4. F5 to delete entire row
Sub DeleteEntireRow()

Dim i As Long, searchString As String

For i = Range("A" & Rows.Count).End(xlUp).Row To 1 Step -1

searchString = LCase(Range("A" & i))

If (InStr(1, searchString, ".exe") > 0) Or _
(InStr(1, searchString, ".png") > 0) Or _
(InStr(1, searchString, ".jpg") > 0) Then
Rows(i).Delete
End If

NextRow:
Next i

End Sub