View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Delete a list of rows

In column C and D of the active sheet I had (row 1 to 6)

Sheet2 1
Sheet1 3
Graph Data 5
Sheet2 10
Sheet2 15
Sheet1 10

Sheets were Sheet1, Sheet2, Graph Data, Sheet4. Sheet4 was active and
contained the above.

Sub BBB()
numrows = 6
For i = numrows To 1 Step -1
Worksheets(Cells(i, 4).Value).Rows(Cells(i, 5).Value) _
.EntireRow.Clear
Next

End Sub

worked fine for me. Adapt it to your situation.

--
Regards,
Tom Ogilvy


"John Fevens" wrote in message
...
Tom,


Thanks for you response.

A couple of questions....if I change delete to clear will that also
work? I would rather leave the row nums in tact.

Alos, when I did a trila of your code I am getting a inval or
unqualified ref.


Maybe someday I should just break down and actaully learn some VBA!



Bill



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!