How do I delete a row from a spreadsheet if criteria is not met i.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a spreadsheet, a column has 30 minutes or 60 minutes. Is there a way to
delete the entire row if the minutes <> 30?
 
Need VBA for that


Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "A").Text = "00:30" Or Cells(i, "A").Text = "01:00" Then
Rows(i).Delete
End If
Next i
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top