Moving worksheets between diferent workbooks

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hello,

I need to move a worksheet from an old workbook to
another workbook.
The worksheet that I want to move has macros and I want
to move it with everything-macros, buttons of macros,
formatting etc.

What is the easiest way to do that?

Thanks in advance
Tim
 
copy the sheet

Edit=> move or copy sheet

I would make a copy until I knew it did what I want. (click the make a
copy checkbox)

Regards,
Tom Ogilvy
 
You will also need to copy across any Macros from that workbook to the new workbook. This can
easily be done by opening both books, then hitting ALT+F11 to get into the VBE. From here you
will see an explorer type view at the top left of the screen that looks something like this.
Within this pane you need to search for your workbook's name, and when you find it you may need to
click on the + to expand it. Within that you should see the following:-

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
ThisWorkbook
Modules
Module1
Module2
etc etc (You may have just 1 of these)

If you have named your sheets then those names will appear in the brackets above as opposed to
what you see at the moment in my note.

You need to click on and then drag the module (Which houses the macros) from your old workbook to
the new workbook.

Another option perhaps, is to simply save the file down as a new name and then edit it to reflect
what should be in the new book.
 
If you copy a sheet as Tom says, the sheet macros come with it.

And you will also may need to copy any class modules and forms. Forms re
more awkward as they have the form itself as well as the textual code, so
these are best exported and imported afresh.
 
If you copy a sheet as Tom says, the sheet macros come with it.

Yes, My assumption was that the OP wanted only sheet code - code specific to
the sheet being copied.

Regards,
Tom Ogilvy
 
Back
Top