Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete rows in excel

Status
Not open for further replies.

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:
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top