Results 1 to 3 of 3
  1. #1
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy multiple worksheets (2000 & up)

    I have a workbook with three worksheets and have been copying a single worksheet to create a new workbook using:
    Workbooks(xxx).Sheets(yyy).Copy

    I now wish to create a new workbook with two of the worksheets. Is there a straightforward way to do this, other than (say) copy the entire workbook, delete the one unwanted worksheet and delete all the included code?

    TIA

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Copy multiple worksheets (2000 & up)

    You could use the code: Sheets(Array("Sheet1", "Sheet2")).Copy
    This is not very interactive though. If the sheets you need to copy will vary, then you may want the macro to prompt for the sheet names, etc!
    The above code will always copt only sheet 1 and sheet 2
    Regards,
    Rudi

  3. #3
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy multiple worksheets (2000 & up)

    Works perfectly, thanks.
    (The worksheet names are always the same, so I can use those with no problem.)

Posting Permissions

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