Feb 27, 2007 #1 Injun IS-IT--Management Dec 17, 2002 30 US Code: oSelection = DirectCast(csheet.Rows("1:2"), Excel.Range) oSelection.Delete() How can I delete the first 2 rows in an excel worksheet? Apprantly the above code does nothing . Please help thx
Code: oSelection = DirectCast(csheet.Rows("1:2"), Excel.Range) oSelection.Delete() How can I delete the first 2 rows in an excel worksheet? Apprantly the above code does nothing . Please help thx
Feb 27, 2007 #2 kss444 Programmer Sep 19, 2006 306 US http://www.ozgrid.com/VBA/VBACode.htm Upvote 0 Downvote
Feb 28, 2007 #3 RonRepp Technical User Feb 25, 2005 1,031 US Code: Dim XL as Object XL=CreateObject("Excel.Application") XL.Rows("1:2").Select XL.Selection.Delete (Excel.XlDirection.xlUp) I hope this helps. ... Ron Repp If gray hair is a sign of wisdom, then I'm a genius. Upvote 0 Downvote
Code: Dim XL as Object XL=CreateObject("Excel.Application") XL.Rows("1:2").Select XL.Selection.Delete (Excel.XlDirection.xlUp) I hope this helps. ... Ron Repp If gray hair is a sign of wisdom, then I'm a genius.