Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ken Sanders   on Nov 03 In MS Office Category.

  
Question Answered By: Gustavo Costa   on Nov 03

Sorry I wasn't clear. I am working with a list of data  in an excel
spreadsheet. As I described, my code  finds the first row that I want
to delete  by increasing the value of the variable  "firstrow" until it
finds a name I am looking for in the first column. Then it sets a
counter at 1 and increases it to 30, eliminating rows(firstrow)
before each increment. The code follows:

firstrow= 2
ActiveWorkbook.Sheets("Data").Cells(2, 1).Select
Do While Cells(firstrow, 1).Value <> frmNameSelect.NametoCut.Value
firstrow = firstrow + 1
loop
For i = 1 to 30
Rows(firstrow).Select
Selection.Delete Shift:=xlUp
Next i

But I don't know how to delete the set of rows  beginning
with "firstrow" other than one at a time.

Thanks for the help.

Share: 

 

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

 
Didn't find what you were looking for? Find more on delete multiple rows Or get search suggestion and latest updates.


Tagged: