If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
delete multiple rows
I want to delete rows 4,6,8,10,12 etc etc.... So, from row 4, I want to
delete every other row. My rows go up to 4000 or so Any ideas? |
#2
|
|||
|
|||
delete multiple rows
Managed to do it with a Macro
Thanks anyway Continental Translations wrote in message ... I want to delete rows 4,6,8,10,12 etc etc.... So, from row 4, I want to delete every other row. My rows go up to 4000 or so Any ideas? |
#3
|
|||
|
|||
delete multiple rows
Sub Delete_OddorEvenRows()
Dim rngStart As Range Dim rngDel As Range Dim rngTemp As Range Dim rowCount As Long oddeven = InputBox("Enter 1 To Delete Odd Rows or 2 To Delete Even Rows") If oddeven = "" Then Exit Sub Application.ScreenUpdating = False If oddeven = 2 Then Range("a1").Select With Selection .EntireRow.Insert End With GoTo keepon Else keepon: Set rngStart = Range("1:1") Set rngTemp = rngStart For rowCount = 1 To ActiveSheet.UsedRange.Rows.Count If rowCount Mod 2 = 0 Then Set rngDel = rngStart.Offset(rowCount, 0) Set rngTemp = Union(rngTemp, rngDel) End If Next rngTemp.Select Selection.EntireRow.Delete End If Application.ScreenUpdating = True Range("A1").Select End Sub Gord Dibben Excel MVP On Tue, 15 Jun 2004 00:54:51 +0000 (UTC), "Continental Translations" wrote: I want to delete rows 4,6,8,10,12 etc etc.... So, from row 4, I want to delete every other row. My rows go up to 4000 or so Any ideas? |
Thread Tools | |
Display Modes | |
|
|