+ Reply to Thread
Results 1 to 12 of 12

Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi.
    How can I export to excel file a group of sheets?
    Imagine that I have 7 tabs(1,2,3,4,5,6,7) in my real file, what I need is, export tabs(1,2,3,4,6) to new file named "LF_Entrada.xlsx" and export tabs(1,2,3,5,7) to new file named "LF_Saida.xlsx"

    Please Login or Register  to view this content.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    I try do this way
    Please Login or Register  to view this content.
    Maybe because I have 2 tabs with pivottable, after run error 1004 display
    When i remove pivottable the run without erro

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi ...

    Any idea?

    Thanks

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi....
    Please, someone can help me?

    Thnks

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi....
    Please, someone can help me?

    Thnks

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    look in my module mExportAsFile my sub ExportarArquivo
    I need export pivottable after run code in #2, this play error.

    link to download
    Attached Files Attached Files

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi again,

    Thank you for your private message regarding this thread.

    The following code seems to do what you need - it does not perform the "Copy Values" operation on worksheets which contain a PivotTable:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  8. #8
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi Greg

    When I run your code, I don't know way, but never stop.

    Thank you for reply

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Quote Originally Posted by marreco View Post
    Hi.
    How can I export to excel file a group of sheets?
    Imagine that I have 7 tabs(1,2,3,4,5,6,7) in my real file, what I need is, export tabs(1,2,3,4,6) to new file named "LF_Entrada.xlsx" and export tabs(1,2,3,5,7) to new file named "LF_Saida.xlsx"
    Please Login or Register  to view this content.

  10. #10
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi again,

    I've attached my copy of the workbook which seems to work correctly on my system.

    Run the "ExportTabToFile" routine (i.e. NOT the routine which runs from the "Exportar" button on the AddIns tab) and see if it works correctly for you.

    Hope this helps - as before, please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi Greg M and Jindon.

    Greg M, you're right when I run your code in separated module (without on Addins tab), works well, thanks!!

    Jindon, your code works well too, thanks

    Thank you both of you!!
    Last edited by marreco; 04-23-2019 at 08:32 PM.

  12. #12
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Export a group_A tabs to new workbook_A and group_B tabs to new workbook_B

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated!

    You're welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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 2 tabs into 2 tabs in a new file
    By Lana74 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-14-2017, 03:27 PM
  2. 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
  3. 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
  4. Export Text File Without Tabs
    By barshnizza in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-20-2012, 10:18 AM
  5. Macro to export cetain tabs
    By mjhopler in forum Excel General
    Replies: 1
    Last Post: 07-28-2010, 09:15 AM
  6. 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
  7. Export several excel tabs to pdf (or similar)
    By MarkFerdinandson in forum Excel General
    Replies: 7
    Last Post: 09-02-2009, 11:04 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