+ Reply to Thread
Results 1 to 3 of 3

Duplicate all Macros?

  1. #1
    SteveC
    Guest

    Duplicate all Macros?

    This is part of a macro that duplicates sheets into a new workbook and lets
    me save them someplace else... only problem, it leaves behind all macros....
    how do I take all macros from the original workbook and duplicate them into
    the new workbook? thanks a lot!

    Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
    "Sheet6")).Select
    Sheets("Sheet5").Activate
    Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
    "Sheet6")).Copy
    Range("A34").Select
    Selection.Copy
    Application.CutCopyMode = False
    ChDir " U:\Folder1\Folder2\Folder3"
    Application.Dialogs(xlDialogSaveAs).Show "U:\Folder1\Folder2\Folder3"


  2. #2
    SteveM
    Guest

    Re: Duplicate all Macros?

    Steve,

    What don't you Save As to a new workbook and then delete the sheets you
    don't want in that workbook?

    SteveM

    SteveC wrote:
    > This is part of a macro that duplicates sheets into a new workbook and lets
    > me save them someplace else... only problem, it leaves behind all macros....
    > how do I take all macros from the original workbook and duplicate them into
    > the new workbook? thanks a lot!
    >
    > Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
    > "Sheet6")).Select
    > Sheets("Sheet5").Activate
    > Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
    > "Sheet6")).Copy
    > Range("A34").Select
    > Selection.Copy
    > Application.CutCopyMode = False
    > ChDir " U:\Folder1\Folder2\Folder3"
    > Application.Dialogs(xlDialogSaveAs).Show "U:\Folder1\Folder2\Folder3"



  3. #3
    SteveC
    Guest

    Re: Duplicate all Macros?

    I wanted to avoid that because all these sheets come from one large workbook,
    and the macro pulls out only the sheets I need --> this is faster than doing
    multiple Save As commands... but i will try to come up with a way to do
    this... thanks for the suggestion...

    "SteveM" wrote:

    > Steve,
    >
    > What don't you Save As to a new workbook and then delete the sheets you
    > don't want in that workbook?
    >
    > SteveM
    >
    > SteveC wrote:
    > > This is part of a macro that duplicates sheets into a new workbook and lets
    > > me save them someplace else... only problem, it leaves behind all macros....
    > > how do I take all macros from the original workbook and duplicate them into
    > > the new workbook? thanks a lot!
    > >
    > > Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
    > > "Sheet6")).Select
    > > Sheets("Sheet5").Activate
    > > Sheets(Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5",
    > > "Sheet6")).Copy
    > > Range("A34").Select
    > > Selection.Copy
    > > Application.CutCopyMode = False
    > > ChDir " U:\Folder1\Folder2\Folder3"
    > > Application.Dialogs(xlDialogSaveAs).Show "U:\Folder1\Folder2\Folder3"

    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1