Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Caroline
 
Posts: n/a
Default How do I delete every seventh row?

I have a big spreadsheet, and need a quick macro or formula to automatically
delete every seventh row.
  #2   Report Post  
PCLIVE
 
Posts: n/a
Default

This may not be the best method, but it will work. In this code, it will
only repeat 10 times. If you know how many "7th" rows will need to be
deleted, then you can adjust the "1 To 10" section. Keep in mind that this
code also assumes that the first row to be deleted, will be row 7. Back up
your work before using this. HTH, Paul

Sub Delete7thRow()
r = 7

For i = 1 To 10
Rows(r).Delete
r = r + 6
Next i

End Sub



"Caroline" wrote in message
...
I have a big spreadsheet, and need a quick macro or formula to
automatically
delete every seventh row.



  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

Insert a new column A
Number the first 7 rows of data, from 1 to 7
Copy those numbers to the bottom of the data
Filter the data for 7s in the first column
Select all the data, then press the F5 key, click on the Special button, and
select Visible Cells Only
Delete those cells
"Unfilter" the data

"Caroline" wrote:

I have a big spreadsheet, and need a quick macro or formula to automatically
delete every seventh row.

  #4   Report Post  
Don Guillett
 
Posts: n/a
Default

something like this.

for i=cells(rows.count,"a").end(xlup).row to 7 step -7
cells(i,"a").entirerow.delete
next i

--
Don Guillett
SalesAid Software

"Caroline" wrote in message
...
I have a big spreadsheet, and need a quick macro or formula to

automatically
delete every seventh row.



Reply
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
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
how do I delete a worksheet from my workbook DLee New Users to Excel 2 August 15th 05 09:59 PM
Delete row depending on criteria adw223 Excel Discussion (Misc queries) 1 June 30th 05 12:55 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
How to delete blank rows John Mansfield Excel Discussion (Misc queries) 3 April 27th 05 11:48 PM


All times are GMT +1. The time now is 05:18 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"