ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Runtime error '1004' Cannot change part of a merged cell (https://www.excelbanter.com/excel-programming/413878-runtime-error-1004-cannot-change-part-merged-cell.html)

[email protected]

Runtime error '1004' Cannot change part of a merged cell
 
Hello,
I have an Excel 2003 VBA app that while I am programmatically deleting
all but the last 3 sheets that remain-after they are deleted-I get the
above error. It won't allow me to set a break point in the code but
the error apparently occurs at the end of performing the For
statement, and doesn't perform any code afterwards.

For ndx = Workbooks("Quotes.xls").Worksheets.Count To 4 Step -1

Workbooks("Quotes.xls").Worksheets(ndx).Delete

Next ndx
The code to my knowledge is not affecting the merged cells unless
inadvertently. Any ideas what the problem could be. I am past a
deadline for getting a demo to a client so any help would be
appreciate. Thanks, God bless, Van


All times are GMT +1. The time now is 09:03 AM.

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