Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete multiple rows without a loop in Excel VBA

Tags:

excel

vba

Frequently we are asked how to delete rows based on criteria in one or more columns, and can we use a SpecialCells trick for this?

like image 780
Our Man in Bananas Avatar asked Oct 21 '25 02:10

Our Man in Bananas


1 Answers

This will delete row numbers m to n passed through the function

Sub Delete_Multiple_Rows (m as Integer, n as Integer) 

    Rows(m & ":" & n).EntireRow.Delete 

End Sub
like image 180
Toor Avatar answered Oct 23 '25 17:10

Toor