Runtime error '1004' Cannot change part of a merged cell

K

KingdomCome

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top