Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jc40
 
Posts: n/a
Default Cutting every other row from a spreadsheet

I have a large spreadsheet which I want to cut in half. I want to delete
every second row. Is there a formula I can use to do that and then re-paste
the new spreadsheet in a separate sheet?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Leith Ross
 
Posts: n/a
Default Cutting every other row from a spreadsheet


Hello Jc40,

First copy the Macro code below using Ctrl + C. With your workbook
open, press Alt + F11 to open the VB Editor. Next insert a standard VBA
Module into your project.

To add a new Module:
Press Alt + I to drop down the Insert menu.
Press M to insert the new Module
Press Ctrl + V to paste the code into the Module
Press Ctrl + S to save the Macro
Press Alt + Q to quit the Editor and return to Excel

To Run the Macro:
Select the worksheet you want to cut in half
Press Alt + F8 to display the Macro List
Click on CutInHalf and press Enter

Macro Code:

Public Sub CutInHalf()

Dim EndRow As Long
Dim StartRow As Long
Dim NewRow As Long
Dim NewWks As Worksheet
Dim OldWks As Worksheet
Dim R As Long

Set OldWks = ActiveSheet
With OldWks.UsedRange
StartRow = .Row
EndRow = .Rows.Count + .Row - 1
End With

ActiveWorkbook.Worksheets.Add After:=OldWks
Set NewWks = ActiveSheet

For R = StartRow To EndRow Step 2
NewRow = NewRow + 1
OldWks.Cells(R, "A").EntireRow.Copy
Destination:=NewWks.Cells(NewRow, "A").EntireRow
Next R

End Sub


Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=546975

  #3   Report Post  
Posted to microsoft.public.excel.misc
Paul Sheppard
 
Posts: n/a
Default Cutting every other row from a spreadsheet


A quick way to get rid of every other row is to add an extra row and
fill down this row with 1 and 2 alternately, then filter to show either
the 1's or 2's and select the filtered rows and delete them


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=546975

  #4   Report Post  
Posted to microsoft.public.excel.misc
Paul Sheppard
 
Posts: n/a
Default Cutting every other row from a spreadsheet


A quick way to get rid of every other row is to add an extra row and
fill down this row with 1 and 2 alternately, then filter to show either
the 1's or 2's and select the filtered rows and delete them


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=546975

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
How to handle multiple currencies with one spreadsheet Michael Mullican Excel Discussion (Misc queries) 1 October 5th 05 05:18 PM
Using Excel spreadsheet as input to Access dougb415 Excel Discussion (Misc queries) 0 September 22nd 05 02:33 PM
Spreadsheet merging problems Sam B Excel Worksheet Functions 0 September 19th 05 08:05 PM
Linkage data between two spreadsheet vitality Excel Worksheet Functions 2 September 15th 05 06:49 AM
Linking formula to external spreadsheet Tunde Excel Discussion (Misc queries) 1 March 1st 05 03:05 AM


All times are GMT +1. The time now is 05:31 PM.

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"