+ Reply to Thread
Results 1 to 8 of 8

Export 2 tabs into 2 tabs in a new file

  1. #1
    Registered User
    Join Date
    02-12-2010
    Location
    NY
    MS-Off Ver
    Excel 2019
    Posts
    47

    Export 2 tabs into 2 tabs in a new file

    Hello,

    I have an Excel file with, let's say, 10 tabs: Template1, Template2, Template3 etc, with similarly structured data in all of them.

    I need users to be able to export it to another file. Right now I have code that exports Template1 into Template1 tab in a new file. What I'm struggling with is to how to modify it to let users to export 2 tabs: so Template1 and Template2 from existing file, to Template1 and Template2 in the new file. Here is the code. Thank you so much in advance!!!!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: Export 2 tabs into 2 tabs in a new file

    Maybe:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    02-12-2010
    Location
    NY
    MS-Off Ver
    Excel 2019
    Posts
    47

    Re: Export 2 tabs into 2 tabs in a new file

    Thanks Mumps1! It's almost what I wanted. The only problem is that it copies all tabs. So if I have Main, Template1 and Template2, it copies all 3 into the new file. But I only want Template1 and Template2, not Main. Does that makes sense? Thank you again!!!

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: Export 2 tabs into 2 tabs in a new file

    The code is written to only Templates 1 and 2. I'm not sure why it's also copying "Main". Can you attach a copy of your file?

  5. #5
    Registered User
    Join Date
    02-12-2010
    Location
    NY
    MS-Off Ver
    Excel 2019
    Posts
    47

    Re: Export 2 tabs into 2 tabs in a new file

    Sorry, I was a little off. If I have Main, Template1 and Template2, it creates Sheet1,Template1 and Template2. Is there a way not to have Sheet1? Thanks again!!!

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: Export 2 tabs into 2 tabs in a new file

    Try:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-12-2010
    Location
    NY
    MS-Off Ver
    Excel 2019
    Posts
    47

    Re: Export 2 tabs into 2 tabs in a new file

    That worked! Thanks so much!!!

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,833

    Re: Export 2 tabs into 2 tabs in a new file

    You are very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Export tabs as one file to folder
    By Pi* in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2017, 12:22 AM
  2. VBA to export specific tabs to excel and PDF
    By tmleynek in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2015, 08:54 AM
  3. Copy Tabs from different excel file by using code name of the tabs
    By varun.kalra1988 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2014, 02:03 PM
  4. How Do I split a file into several Tabs, acording to information on other tabs?
    By Edinson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2013, 05:17 AM
  5. Export Text File Without Tabs
    By barshnizza in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2012, 10:18 AM
  6. Macro to export cetain tabs
    By mjhopler in forum Excel General
    Replies: 1
    Last Post: 07-28-2010, 09:15 AM
  7. Export from SQL Table to Worksheet Tabs
    By akhlaq768 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-27-2009, 09:58 AM

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