LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Delete Multiple Rows based on Selection

I want to be able to select cells B2:B9 (or any cells in order in a
coloumn), and use a macro to delete rows 2 - 9 starting with row 9 and
going to row 2 using a loop. I have a routine written for deleting 1
row, if 1 cell is selected. How would I use that routine to delete
multiple rows?

For i = 0 To tis - 13
If Range("B" & 11 + i).Value = activecell.Value Then
Range("A" & 11 + i & ":H" & 11 + i).Delete Shift:=xlUp
activecell.Select
Exit Sub
End If
Next i

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete columns based on selection Steve Excel Discussion (Misc queries) 0 December 7th 09 09:38 PM
Delete rows based on multiple criteria puiuluipui Excel Discussion (Misc queries) 6 July 3rd 09 01:58 PM
Delete Entry Based on Selection AntnyMI Excel Discussion (Misc queries) 1 September 16th 06 06:24 PM
Delete rows based on multiple criterias Benson Excel Discussion (Misc queries) 8 November 2nd 05 03:11 PM
Delete Row Based on Listbox Selection Hartman Excel Programming 1 April 26th 05 06:51 AM


All times are GMT +1. The time now is 04:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"