Hey guys,
Im using Excel 2013 and I'm getting an issue in vba I can't figure out. (This is something I've done several dozen time before) But everytime I try to copy a sheet in a workbook,
Sheets("Sheet1").Copy After:=WB.Sheets(WB.Sheets.Count)
I recently copied in this sheet from another workbook, and deleted all of it's formula names, but I can't copy any other sheets now either.
the Run time Error 1004: Copy method of Worksheet Class failed pops up. What is weird is that I put in a msgbox and
returns a "1" though the sheet has about a dozen sheets within it. Anything I'm missing? Ive saved the workbook and even saved it as another name.
Update: So it looks like I have a very hidden sheet in my WB for some weird reason, I'll be trying to remove that (it won't let me currently) and see if it works
Update: Deleted the very hidden sheet but the error is still showing up, the sheet I imported has a sheet number of 77 while the previous last sheet was 23, could this be a cause?
Update: Fixed, it looks like when I was setting WB = thisworkbook and a few other methods it was refering to my Personal workbook. I changed it to activeworkbook and its working now. No clue why it did that. Any thoughts?
Bookmarks