• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel VBA to copy ALL items in a corrupt sheet to new one

Krishna Khemraj

New Member
I have a complicated worksheet that contains many form buttons, dropdowns, named ranges, shapes, named ranges, page formatting, comments and VBA code.

That sheet sends up Run-time Error 32809, which I assume there is something corrupted in the sheet.

Does anyone have code to copy ALL items on a worksheet to another one, including the form buttons, dropdowns, named ranges, shapes, named ranges, page formatting, comments?
 
Right-click on the sheet, Move or copy.

The run time error is coming from the VB code, so if you have any code in the sheet module, you could delete that. Or better yet, debug the code, and figure out what's causing the problem.
 
Code is good. Been working for a while now. It was an Activex Button that was the issue. Couldn't delete it. Every time I tried, the workbook crashed. O copied all data to a new sheet, (button didn't copy - indicating it was the culprit) manually moved all the named ranges, reset the page formatting, moved all the sheet VBA to the new sheet . . . Deleted the old sheet and renamed the new sheet to mimic the old broken one. Everything works again.

I was just wondering if anyone had some code that would mimic that. Something like this:
for each object in objects
for each namedrange in ranges
for each pagebreak in pagebreaks
...
next pagebreak
next namedrange
next object
 
Back
Top