Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Macro to delete rows

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)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Macro to delete rows

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


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Ken G" wrote in message
...
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)


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
Macro to delete 2 rows every 500 rows [email protected] Excel Programming 3 February 3rd 08 01:52 PM
macro to delete rows Patrick Excel Programming 0 October 15th 04 02:39 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
HOW TO: Delete Rows with a Macro Jase Excel Programming 0 September 11th 03 06:05 AM


All times are GMT +1. The time now is 09:57 AM.

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"