View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Deleting every other row


Sub Macro1()
Dim a As Long

Application.ScreenUpdating = False
For a = 150 To 2 Step -2
Rows(a).Delete
Next a
Application.ScreenUpdating = True

End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"nir020" wrote in message
...
I am trying to write a macro that deletes every other row in spreadsheet,

I
have written the following code

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 15/11/2006 by readn
'

'
Dim M As Range
Dim n As Integer

n = 9
Set M = Range("n.value:n.value")


For a = 1 To 150


M.Select
Selection.Delete Shift:=xlUp
n=n+2

Next a

End Sub

But I cannot get to work, any suggestions?