Macro to delete rows

K

Ken G

I have a list of daily data that is one day per row, I need a macro to trim
it back from daily data to weekly data retaining only Friday's data for each
week, so I need to delete 4 rows, skip a row and delete the next 4 rows etc.
The list is currently about 400 rows. (Excel 2003)
 
R

Rich Locus

OssieMac:

It looks like we are on the "same page". We must have posted seconds apart.
 
D

Don Guillett

Instead of deleting why not just filter on Friday...
However, if you insist, work from the bottom up

Sub deleteallbutfriday()
mc = "a" 'change to suit
For i = Cells(Rows.Count, mc).End(xlUp).Row To 5 Step -5
Rows(i - 4).Resize(4).Delete
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top