Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a Pattern of Rows
Okay, I want to select rows 1,2.....47, 48.......93,94......etc etc on to
infinity. It is that pattern, so every 45th and 46th row, then have the entire row deleted. How might I go about doing this??? Don't ask me why, it's just one part of what I want my macro to do. I am at a loss for how to write a formula up for this. THANKS!!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a Pattern of Rows
Does this work?
i = 65505 do Rows(i).delete shift:=xlUp Rows(i).delete shift:=xlUp i = i - 46 while i 0 Die_Another_Day bodhisatvaofboogie wrote: Okay, I want to select rows 1,2.....47, 48.......93,94......etc etc on to infinity. It is that pattern, so every 45th and 46th row, then have the entire row deleted. How might I go about doing this??? Don't ask me why, it's just one part of what I want my macro to do. I am at a loss for how to write a formula up for this. THANKS!!! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a Pattern of Rows
Sub AAA()
Set rng = Cells(1, 1).Resize(2, 1) For i = 45 To 500 Step 45 Set rng = Union(rng, Cells(i, 1).Resize(2, 1)) Next rng.EntireRow.Select End Sub if that selects the rows you want, then change Select to Delete and run it again. Change 500 to any number up to 65536 -- Regards, Tom Ogilvy "bodhisatvaofboogie" wrote: Okay, I want to select rows 1,2.....47, 48.......93,94......etc etc on to infinity. It is that pattern, so every 45th and 46th row, then have the entire row deleted. How might I go about doing this??? Don't ask me why, it's just one part of what I want my macro to do. I am at a loss for how to write a formula up for this. THANKS!!! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting a Pattern of Rows
Does this work?
i = 65505 do Rows(i).delete shift:=xlUp Rows(i).delete shift:=xlUp i = i - 46 while i 0 Die_Another_Day bodhisatvaofboogie wrote: Okay, I want to select rows 1,2.....47, 48.......93,94......etc etc on to infinity. It is that pattern, so every 45th and 46th row, then have the entire row deleted. How might I go about doing this??? Don't ask me why, it's just one part of what I want my macro to do. I am at a loss for how to write a formula up for this. THANKS!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting Rows in A Pattern | Excel Discussion (Misc queries) | |||
Deleting Rows in a Pattern | Excel Discussion (Misc queries) | |||
Deleting Rows In A Pattern | Excel Discussion (Misc queries) | |||
Selecting a Pattern of Cells | Excel Programming | |||
repeat rows pattern through pages | Excel Discussion (Misc queries) |