+ Reply to Thread
Results 1 to 5 of 5

VBA export sheets from open workbook to closed workbooks

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    New York, US
    MS-Off Ver
    2013
    Posts
    43

    VBA export sheets from open workbook to closed workbooks

    Hi gurus,

    Thanks in advance to anyone who takes the time to respond!

    I'm trying to create a macro which will loop through each sheet in a workbook called 'Syndication_Macro.xlsm' and copy the sheets to other workbooks.

    The folderpath is the same for each workbook and the workbooks are named after the sheets to be exported. i.e.

    Sheet 1 should be exported to:
    "C:\Syndication\Sheet1.xlsx"

    Sheet 2 should be exported to:
    "C:\Syndication\Sheet2.xlsx"

    etc. etc.

    I haven't had much luck by myself so would appreciate any help!

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

    Re: VBA export sheets from open workbook to closed workbooks

    Hi there,

    Try the following code and see if it does what you need:

    Please Login or Register  to view this content.
    The above code will create a new workbook for each worksheet in the workbook which contains this code.



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

    Regards,

    Greg M
    Last edited by Greg M; 08-27-2015 at 05:38 PM. Reason: Note re new workbooks added

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,620

    Re: VBA export sheets from open workbook to closed workbooks

    Do you want to export the worksheets to existing workbooks?

    Or do you want to create new workbooks?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    07-20-2015
    Location
    New York, US
    MS-Off Ver
    2013
    Posts
    43

    Re: VBA export sheets from open workbook to closed workbooks

    Thanks for the code Greg, it worked for the first sheet but then resulted in an error at

    Please Login or Register  to view this content.
    for the second sheet.

    Norie, I want to export the sheets to existing workbooks (as the last sheet). Apologies for not being more clear, would appreciate any help!

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    New York, US
    MS-Off Ver
    2013
    Posts
    43

    Re: VBA export sheets from open workbook to closed workbooks

    Any chance of getting this to work Norie or am I dreaming?

+ 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. Macro to get values from multiple closed workbooks into single open workbook
    By aman2059 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-10-2015, 08:36 AM
  2. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  3. Import all sheets from closed workbook to the open workbook
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2013, 04:05 AM
  4. Replies: 12
    Last Post: 07-03-2013, 01:35 PM
  5. Import data from several closed workbooks to a single sheet in an open workbook
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2013, 06:35 AM
  6. Copy 2 sheets from a open workbook and paste to a closed workbook
    By grimston in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2012, 03:27 PM
  7. Parse Data from closed workbooks, export to additional sheets
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2010, 08:34 PM

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