Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Rainhard Fischer   on Mar 07 In MS Office Category.

  
Question Answered By: Adalie Fischer   on Mar 07

The only reason to do it backwards is if you do not plan to keep track of
the deletions or do not want to try and work out the new end condition.

To delete the 3rd to 6th row you can

For i = 6 to 3 Step -1
Worksheets("Sheet1").Rows(i).Delete
Next i

Or

j = 3
For i = 1 to 4
Worksheets("Sheet1").Rows(j).Delete
Next i

Which is the same as:

Worksheets("Sheet1").Rows(3).Delete
Worksheets("Sheet1").Rows(3).Delete
Worksheets("Sheet1").Rows(3).Delete
Worksheets("Sheet1").Rows(3).Delete

Share: 

 

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

 
Didn't find what you were looking for? Find more on Deleting Non-consecutive rows in VBA Or get search suggestion and latest updates.


Tagged: