ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Rows from List Objects based on Conidtion (https://www.excelbanter.com/excel-programming/362839-delete-rows-list-objects-based-conidtion.html)

george-v

Delete Rows from List Objects based on Conidtion
 
Only a part of code.

Set wrksht = ActiveWorkBook.WorkSheets("Query6")
Set objListobj=wrksht.ListObjects(1)
Set objListRows=objListobj.ListRows

I am getting an error message which says "subscripts out of range", Run time
error '9' at the second line of code shown above

Tom Ogilvy

Delete Rows from List Objects based on Conidtion
 
Set wrksht = ActiveWorkBook.WorkSheets("Query6")
if wksheet.ListObject.count = 0 then
msgbox "No ListObject"
exit sub
end if
Set objListobj=wrksht.ListObjects(1)
Set objListRows=objListobj.ListRows

--
Regards,
Tom Ogilvy


"george-v" wrote:

Only a part of code.

Set wrksht = ActiveWorkBook.WorkSheets("Query6")
Set objListobj=wrksht.ListObjects(1)
Set objListRows=objListobj.ListRows

I am getting an error message which says "subscripts out of range", Run time
error '9' at the second line of code shown above



All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com