+ Reply to Thread
Results 1 to 7 of 7

VBA code export sheets as new workbooks

  1. #1
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    VBA code export sheets as new workbooks

    I have a workbook with three sheets (sheet 1, sheet 2, sheet 3)

    I want to export those sheets as separate .xlsx workbooks (3 new files) with the name Date-#

    For example, if sheet 1 has 11/6/14 in cell A1 and the number 2 in cell A2 i want the name to be: 11-6-14-2

    Any ideas?

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA code export sheets as new workbooks

    Please Login or Register  to view this content.

    Or simply

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 11-06-2014 at 05:46 PM.

  3. #3
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: VBA code export sheets as new workbooks

    That works. Only, it makes the file name "11-05-2014 2"
    Can it be displayed as "11-05-14-2?"

    Also, can we add "protect sheet" to it with a password and change the file path? Default is my documents

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA code export sheets as new workbooks

    Please Login or Register  to view this content.
    To change the path:

    Record yourself saving a file to your required folder and modify the above line to refer to that folder:

    Please Login or Register  to view this content.
    Becomes:-

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: VBA code export sheets as new workbooks

    That codes works, but it is still displaying the year as 2014. is there a way to display the year as just '14'? if not, that's fine. Not that big of a deal.

    I would really like to make the output files password protected. Is there a way to do that? I want viewers to be able to copy the sheet, but not edit it.

    Thanks

  6. #6
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: VBA code export sheets as new workbooks

    Actually, the way file is being saved is fine.
    Any code that can be used to automatically password protect the sheet?

  7. #7
    Forum Contributor
    Join Date
    12-18-2011
    Location
    long island
    MS-Off Ver
    365
    Posts
    236

    Re: VBA code export sheets as new workbooks

    Figured it out.

    Thank you

+ 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. Need help with code to export only certain sheets
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-24-2013, 06:09 AM
  2. [SOLVED] Export specific sheets into 1, 2, or 3 workbooks, depending on cell value
    By Ppsych in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-25-2013, 01:46 PM
  3. Export several sheets to number of different workbooks
    By thylander in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2011, 12:12 PM
  4. 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
  5. Export sheets to new workbooks
    By johnyc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2008, 08:01 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