Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default 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
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
Selecting a Pattern of Cells bodhisatvaofboogie Excel Programming 4 June 6th 06 06:57 PM
repeat rows pattern through pages juststarter Excel Discussion (Misc queries) 2 March 17th 06 01:21 PM


All times are GMT +1. The time now is 07:49 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"