Home > Back-end >  Call 'Move or Copy' Dialog
Call 'Move or Copy' Dialog

Time:07-12

In EXCEL there is an on-board 'Move or Copy' dialog, which can be started by clicking right on one or more sheets. The advantage of this feature is that a little window (see picture) is opened, and the user can select the destination. I wanted to add this routine to an existing sub. I know how to copy a sheet using VBA, that's not a problem, I wanted the same little window, and I was wondering if I can use the on-board routine. I have tried recording, but the window for selecting the destination did not occur in the code. Of course, I can simply rebuilt it, but why reinventing the wheel? Is there a way of calling the routine?

enter image description here

CodePudding user response:

It's a built-in dialog:

application.Dialogs(xldialogworkbookmove).Show

You can also use xldialogworkbookcopy and you should basically get the same dialog but with the checkbox at the bottom checked.

  • Related