Forum Discussion
Error when copying or moving a sheet, name already exist
How did you get there and what are you trying to achieve exactly? Sounds like you're duplicating all the sheets in a workbook within that same workbook?
Bennadeau, I am moving the sheet from one workbook to the next, but the workbook i am moving the sheet to has a similar sheet.
- BennadeauSep 03, 2020Iron Contributor
I see... can you delete the sheet in the destination workbook before moving these?
You could use VBA to do that operation if you have to do this often. I'm sure there's a way to force the operation in the code without confirmation prompt. (equivalent to "Yes to All"). Let me know if it's a recurring thing, I'll try to dig up a code for you. If it's a one time thing, I suggest you stick with deleting before copying.
- KaydeannSep 03, 2020Copper Contributor
Bennadeau I need the other sheet in the workbook so i can't delete before copying. I need to find a way to get the "yes to all" as i am copying similar sheets into the workbook.
- BennadeauSep 03, 2020Iron Contributor
Didn't mean to delete the whole workbook, just the sheets you won't need.
Say you have source.xlsx and destination.xlsx
Both have the following sheet: sheet1, sheet2 and sheet3
You want to copy only sheet1 and sheet2 from source.xlsx to destination.xlsx
In destination.xlsx, delete sheet1 and sheet2
From source.xlsx, copy sheet1 and sheet2 to destination.xlsx
That way, sheet3 in destination.xlsx will remain untouched.
Would that work?