ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Delete every 3rd row (https://www.excelbanter.com/excel-discussion-misc-queries/94024-delete-every-3rd-row.html)

kotlon

Delete every 3rd row
 

Can this be done quickly? For example you have 300 rows and you wanna
delete 1,4,7,10 etc...?


--
kotlon
------------------------------------------------------------------------
kotlon's Profile: http://www.excelforum.com/member.php...o&userid=35431
View this thread: http://www.excelforum.com/showthread...hreadid=552000


Don Guillett

Delete every 3rd row
 
a backwards looping macro something like

Sub deleteeverythridrow()
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -2
Rows(i).Delete
Next i

End Sub
--
Don Guillett
SalesAid Software

"kotlon" wrote in
message ...

Can this be done quickly? For example you have 300 rows and you wanna
delete 1,4,7,10 etc...?


--
kotlon
------------------------------------------------------------------------
kotlon's Profile:
http://www.excelforum.com/member.php...o&userid=35431
View this thread: http://www.excelforum.com/showthread...hreadid=552000




Nikki

Delete every 3rd row
 
if you don't mind sorting:
what if in a column X you type:
1
2
3
copy and paste it to the end, and then sort by the column, you can then
delete all rows with 3 in column x.

"kotlon" wrote:


Can this be done quickly? For example you have 300 rows and you wanna
delete 1,4,7,10 etc...?


--
kotlon
------------------------------------------------------------------------
kotlon's Profile: http://www.excelforum.com/member.php...o&userid=35431
View this thread: http://www.excelforum.com/showthread...hreadid=552000



kotlon

Delete every 3rd row
 

You are genious


--
kotlon
------------------------------------------------------------------------
kotlon's Profile: http://www.excelforum.com/member.php...o&userid=35431
View this thread: http://www.excelforum.com/showthread...hreadid=552000


Don Guillett

Delete every 3rd row
 
Did you even try my solution?

--
Don Guillett
SalesAid Software

"kotlon" wrote in
message ...

You are genious


--
kotlon
------------------------------------------------------------------------
kotlon's Profile:
http://www.excelforum.com/member.php...o&userid=35431
View this thread: http://www.excelforum.com/showthread...hreadid=552000




Nikki

Delete every 3rd row
 
I'm glad it worked for you.

"kotlon" wrote:


You are genious


--
kotlon
------------------------------------------------------------------------
kotlon's Profile: http://www.excelforum.com/member.php...o&userid=35431
View this thread: http://www.excelforum.com/showthread...hreadid=552000



kotlon

Delete every 3rd row
 

Don Guillett, yes I have tried your solution and it worked, but I could
not understand the logic behind the script and when I need to delete
every 2+3+4th row for example I am unable to. Thank you


--
kotlon
------------------------------------------------------------------------
kotlon's Profile: http://www.excelforum.com/member.php...o&userid=35431
View this thread: http://www.excelforum.com/showthread...hreadid=552000



All times are GMT +1. The time now is 08:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com