Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I run the subroutine below I get the following error after some rows
are deleted. I can restart the code and it will run for a few rows and error again. Could someone please tell me what I am doing wrong? TIA Dean --------------------------- Error --------------------------- 1004Application-defined or object-defined error --------------------------- OK --------------------------- Sub DeleteAllListRows() Dim wrksht As Worksheet Dim objListObj As ListObject Dim objListRows As ListRows Dim objLR As ListRow On Error GoTo ErrorHandler Set wrksht = ActiveWorkbook.Worksheets("Drawings") Set objListObj = wrksht.ListObjects(1) Set objListRows = objListObj.ListRows For Each objLR In objListRows If objListRows.Count 0 Then objLR.Delete End If Next Exit Sub ErrorHandler: MsgBox Err.Number & Err.Description, vbOKOnly, "Error" Resume Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help!! I have problem deleting 2500 rows of filtered rows!!!! | Excel Discussion (Misc queries) | |||
Help!!! I have problem deleting 2500 rows of filtered rows | Excel Programming | |||
Deleting Rows Automatically using a Text File List | Excel Discussion (Misc queries) | |||
Problem occur in sum function while deleting the rows | Excel Worksheet Functions | |||
Deleting rows from list of files | Excel Programming |