Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Macro to delete rows

I have a list that i am copying and pasting from a
different location with entirely too much information. I
am looking for a macro to delete 3 rows, leave the 4th,
delete the next 3 and so on. For example: Starting at row
23, leave 23, delete row 24, 25, 26, leave row 27, delete
row 28, 29 and 30, and so on and so forth over a given
range. Can anyone help?


Thanks for your time,
Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Macro to delete rows

Hi Steve,

Sub Test()
Dim Rw, LastRw, Rw3 As String
Rw = 23 ' 1st row
LastRw = 123 ' last row in range
Do
Rw3 = Rw + 1 & ":" & Rw + 3
Rows(Rw3).Delete
Rw = Rw + 1
LastRw = LastRw - 3
Loop Until Rw = LastRw
End Sub

regards,
Don

"Steve" wrote in message
...
I have a list that i am copying and pasting from a
different location with entirely too much information. I
am looking for a macro to delete 3 rows, leave the 4th,
delete the next 3 and so on. For example: Starting at row
23, leave 23, delete row 24, 25, 26, leave row 27, delete
row 28, 29 and 30, and so on and so forth over a given
range. Can anyone help?


Thanks for your time,
Steve



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 rows Hankjam[_2_] Excel Discussion (Misc queries) 4 October 1st 08 03:58 PM
Macro to delete Rows 1, 3 and 10 Rashid Khan Excel Programming 2 June 28th 04 04:03 PM
Macro to delete rows Melanie Breden Excel Programming 2 May 10th 04 11:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
HOW TO: Delete Rows with a Macro Jase Excel Programming 0 September 11th 03 06:05 AM


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