View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Deleting every other row

Also, I forgot to ref the rng...

Function Delete_EvenRows()
Dim rng As Range, n&

Set rng = Sheets("Sheet1").Range("A1:A229")
'Adjust for odd row count
For n = rng.Rows.Count - Mod(rng.Rows.Count, 2) to 2 step -2
rng.Rows(n).Delete
Next
End Function

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus