Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Sebastion Anderson   on Mar 01 In MS Office Category.

  
Question Answered By: Rene Sullivan   on Mar 01

The code worked for me.

Review your code, line wrapping in email messages can cause problems
with code.

This should wrap properly for you. I just made the lines of code
shorter without adjusting any elements of the code.

Sub DeleteCertainRows()
Dim TotalRows As Integer
Dim Counter As Integer
TotalRows = Range("D65536").End(xlUp).row
Range("D1").Activate
For Counter = 1 To TotalRows
If Range("D" & Counter).Value = 25 Or _
Range("D" & Counter).Value = 15 _
Or Range("D" & Counter).Value = 16 Then
Rows(Counter).Delete
End If
ActiveCell.Offset(1, 0).Select
Next

End Sub

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on select cells based on 3 criteria and delete rows Or get search suggestion and latest updates.


Tagged: