Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Delete Every 2nd & 3rd Row

The sequel?

Sub SpeedII()
With ActiveSheet.UsedRange
With .Columns(.Columns.Count + .Column + 1)
.Formula = "=1/n(1+mod(row(a1),3)=2)"
.SpecialCells(xlCellTypeFormulas, xlErrors).EntireRow.Delete
.Value = ""
End With
End With
End Sub


Regards
Robert McCurdy

"excelent" wrote in message ...
The sub looks in column A for the last row with values
Then it use column IV temporary - i ges u dont use that one :-)
try on a copy of ur sheet first, just in case

Sub Speed()
r = Cells(65536, 1).End(xlUp).Row ' if not col.A change '1' to right one
For t = 4 To r Step 3
Cells(t, 256) = 1
Next
Range("IV2:IV" & r).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Range("IV2:IV" & r) = ""
End Sub



"Mickey" skrev:

Hi,
I need to find a quicker way to delete every 2nd & 3rd row of three rows.
e.g. Delete Row 2 & 3, then 3 & 4, then 4 & 6. Can anyone help?, The below
does it but requires me to add a statement for each set of three rows, as
the data can vary from 3 rows to several thousand, I need something more
automatic.

Sub Macro1()
'
'
Rows("2:3").Select
Selection.Delete Shift:=xlUp
Rows("3:4").Select
Selection.Delete Shift:=xlUp
Rows("4:5").Select
Selection.Delete Shift:=xlUp
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Delete Every 2nd & 3rd Row

Thanks Robert,

Mickey


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 sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:54 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:53 PM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 04:38 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM


All times are GMT +1. The time now is 07:00 PM.

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"