Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Select and Delete Every Other Row in Excel Sheet

Hello all

Need to find a Script that would Delete every other row in Excel say starting at Row A1 to Row A100 it would delete A2,A4,A6 and so on

Thanks

Scott

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Select and Delete Every Other Row in Excel Sheet

hi
somthing like this, delete every scecond row

Sub DeleteRows()
Dim i As Long, lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To lastrow Step 2

Rows(i).Delete

Next


End Sub

Regards Yngve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Select and Delete Every Other Row in Excel Sheet

for i = 100 to 1 step -2
rows(i).Delete
Next

--
Regards,
Tom Ogilvy



"Sawyer" wrote:

Hello all

Need to find a Script that would Delete every other row in Excel say starting at Row A1 to Row A100 it would delete A2,A4,A6 and so on

Thanks

Scott

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Select and Delete Every Other Row in Excel Sheet

I like this one straight to the point and easy to change

"Tom Ogilvy" wrote in message
...
for i = 100 to 1 step -2
rows(i).Delete
Next

--
Regards,
Tom Ogilvy



"Sawyer" wrote:

Hello all

Need to find a Script that would Delete every other row in Excel say
starting at Row A1 to Row A100 it would delete A2,A4,A6 and so on

Thanks

Scott



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
Help! Cannot select option buttons when Excel sheet is protected. Jenn Excel Discussion (Misc queries) 1 December 21st 08 06:03 AM
How do I select several control buttons at once on an Excel sheet Sue Blackwell Excel Discussion (Misc queries) 1 April 28th 08 04:53 PM
How do I select all odd-numbered rows in huge excel sheet? bgilliam Excel Discussion (Misc queries) 1 January 5th 07 03:57 PM
Select and Insert one sheet from a multisheet excel template Alex at Europlan Excel Discussion (Misc queries) 0 November 22nd 05 03:51 PM
Select certain rows of sheet & delete the rest Steve Wylie Excel Programming 2 January 9th 04 07:16 PM


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