Deleting every other row

SeattleJim

New Member
Joined
Jun 4, 2007
Messages
20
This has either been asked before or is too simple to where I can't figure it out. I have a column of numbers that are duplicated... so I basically want to delete every other row. Any way of doing it without using dba? Or is that my only way? Thanks.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try this its from a post i was asked about yesterday:

Code:
Sub PullEveryNthRow() 

' Pull every Nth row from the selected range and place those values in 
' a new worksheet. 

   Dim Increment As Long 
   Dim Source As Range 
   Dim TargetSheet As Worksheet 
   Dim SourceRow As Long 
   Dim TargetRow As Long 
    
   ' Use the current selection for the source 
   Set Source = Selection 
    
   ' Query user for the increment 
   Do 
      Increment = InputBox("Enter increment:") 
      If Increment < 1 Then 
         Exit Sub 
      End If 
   Loop Until Increment > 0 

   ' Add a new sheet and move the data 
   Sheets.Add 
   Set TargetSheet = ActiveSheet 
   TargetRow = 1 
   For SourceRow = 1 To Source.Rows.Count Step Increment 
      TargetSheet.Rows(TargetRow). _ 
         Resize(1, Source.Columns.Count).Value _ 
         = Source.Rows(SourceRow).Value 
      TargetRow = TargetRow + 1 
   Next SourceRow 

End Sub

Highlight your column of data....Enter 2 in the pop up box which appears, the macro will cut every 2nd row and paste to a new sheet then use this data.

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,215,528
Messages
6,125,338
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top