Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Looking for a Macro to erase particular rows in a given pattern


I need a Macro to erase particular rows in a given pattern, but I can't find
one on the web. We are testing a new data collector and the raw data can be
opened in Excel. The problem is, we have 30000+ rows of data, but we only
need rows 1, 5, 9, 13, 17, 21 and so on... deleting every three rows manually
is taking forever.

I have to say I'm not used to the macros, but I think I can figure out how
to run one using the spreadsheet.

Can someone give me any suggetsions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default Looking for a Macro to erase particular rows in a given pattern

as long as you have at least one blank column to the right of your data
range, one quick way to do it is like this:

Enter the formula:

=IF(MOD(ROW(A1)-1,4)=0,0,1)

This formula will evaulate to 0 for all of the rows that you want to keep,
and to 1 for all of the rows that you want to delete.

Sort by that formula, delete all of the rows that have a 1 in that column.

I mean do all that in code, not suggesting manually. The only time this
approach would fail is if the furthest right column in the spreadsheet has
something already in it, so be aware of that.
"Quco" wrote:


I need a Macro to erase particular rows in a given pattern, but I can't find
one on the web. We are testing a new data collector and the raw data can be
opened in Excel. The problem is, we have 30000+ rows of data, but we only
need rows 1, 5, 9, 13, 17, 21 and so on... deleting every three rows manually
is taking forever.

I have to say I'm not used to the macros, but I think I can figure out how
to run one using the spreadsheet.

Can someone give me any suggetsions?

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
Deleting Rows in A Pattern DyingIsis Excel Discussion (Misc queries) 1 May 30th 08 10:23 PM
Deleting Rows in a Pattern DyingIsis Excel Discussion (Misc queries) 0 May 29th 08 03:08 PM
Deleting Rows In A Pattern DyingIsis Excel Discussion (Misc queries) 0 May 28th 08 04:21 PM
Erase duplicate rows juanpablo Excel Discussion (Misc queries) 1 April 11th 07 11:46 PM
Can a macro erase it's self after a set criteria? Jeff Excel Worksheet Functions 3 October 13th 05 10:01 AM


All times are GMT +1. The time now is 07:22 AM.

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

About Us

"It's about Microsoft Excel"