Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Darren
 
Posts: n/a
Default How do I delete every other line in an Excel document with over 3.

I have a rather large document where I need to delete every other line
beginning with line 8. I am looking for a shortcut rather than manually
deleting each line.
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
this would require VBA or you may try the following procedure
in B1 put the following formula:
=MOD(ROW(),2)
and copy this down for all rows.
Now apply an autofilter and filter out every 1 or 0 and afterwards delete
the filtered rows

--
Regards
Frank Kabel
Frankfurt, Germany

Darren wrote:
I have a rather large document where I need to delete every other line
beginning with line 8. I am looking for a shortcut rather than
manually deleting each line.



  #3   Report Post  
Jason Morin
 
Posts: n/a
Default

Try this macro:

Sub DeleteRows()

Dim iLastRow As Integer
Dim i As Integer
Dim iRem As Integer

Application.ScreenUpdating = False

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
iRem = iLastRow Mod 2

If iRem = 1 Then
iLastRow = iLastRow + 1
Else
iLastRow = iLastRow
End If

For i = iLastRow To 8 Step -2
Cells(i, "A").EntireRow.Delete
Next i

Application.ScreenUpdating = True

End Sub

---
HTH
Jason
Atlanta, GA

-----Original Message-----
I have a rather large document where I need to delete

every other line
beginning with line 8. I am looking for a shortcut

rather than manually
deleting each line.
.

  #4   Report Post  
Alan Beban
 
Posts: n/a
Default

Darren wrote:
I have a rather large document where I need to delete every other line
beginning with line 8. I am looking for a shortcut rather than manually
deleting each line.


If the functions in the freely downloadable file at
http://home.pacbell.net are available to your workbook, then assuming
your data is on Sheet1 in Columns A:K

Array enter into A1:K7 of an empty sheet =Sheet1!A1:K7

and array enter into A8:A[whatever] of that sheet
=ArrayAlternates(Sheet1!A8:K[whatever],False)

Alan Beban
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
Missing values in Excel Line Chart mw55309 Charts and Charting in Excel 1 January 19th 05 12:10 PM
Excel document properties insert into a cell Mark Excel Discussion (Misc queries) 3 December 16th 04 02:05 PM
Help, insert a word document contents into excel tab? Dan Ward Excel Discussion (Misc queries) 2 December 15th 04 12:01 AM
getting specific info from a word document into excel smintey Excel Discussion (Misc queries) 3 December 8th 04 08:20 PM
Copying an Excel spreadsheet to a Word document KG Excel Discussion (Misc queries) 1 November 28th 04 07:38 PM


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