Delete rows using a macro
Here is a typical example. The macro deletes any rows with "YES" in column B:
Sub YESMan()
n = Cells(Rows.Count, "B").End(xlUp).Row
For i = n To 1 Step -1
If Cells(i, "B").Value = "YES" Then
Cells(i, "B").EntireRow.Delete
End If
Next
End Sub
--
Gary''s Student - gsnu200855
"Sasikiran" wrote:
Hello,
I need help with a macro that will delete certain rows in a spreadsheet.
The rows that need to be deleted are never in the same place, or the same
number of rows. The thing that the rows I want to delete all have in common
a specific word say "YES" in the same column. But they are never in the same
place everytime.
Please suggest me on this.
|