+ Reply to Thread
Results 1 to 1 of 1

Command button, save sheets from master workbook to separated new files.(And more)

  1. #1
    Registered User
    Join Date
    12-14-2017
    Location
    Pattaya,Thailand
    MS-Off Ver
    2010
    Posts
    13

    Command button, save sheets from master workbook to separated new files.(And more)

    I'm having a problem trying to save multiple worksheets into new files. With values only, if possible, which is not for VBA newbie like me I guess.

    This master workbook is called "Form.xlsm". It has 4 certain sheets I want to save into a new separated file for each sheet. They are "Invoice", "WInvoice", "Bill" and "WBill".
    The method to save is clicked a button on the userform and then those 4 sheets will be saved into new files. With values only, no formula, no macro and keep all the formats of course.

    The button is "CommandButton2".
    This button actually has another job. It is to update a customer's order to "CAccounting.xlsx", as you may be noticed below, and this works fine. But if this, any code actually, causes a problem and has to be changed then feel free to let me know.

    For further explanation about the 4 sheets. All data filled in userform will be input to "Invoice". "WInvoice", "Bill" and "WBill" just use "Invoice" as a reference instead.
    All of them have formulas like "sum" and "VLOOKUP" etc. other than "=" they use to get a reference from "Invoice".
    And the last thing, don't know if necessary, those formulas, like "VLOOKUP", refer to hidden sheets in the master workbook.

    Here's the code I came up with. It did not work:

    Please Login or Register  to view this content.
    However, if I remove these 4.

    Please Login or Register  to view this content.
    And enter this instead.

    Please Login or Register  to view this content.
    It works.
    Though it will only save "Invoice" into new file, and still has formulas and macros inside.

    I hope I did explain clear enough. Thanks.
    Last edited by GPMan; 01-05-2018 at 01:55 PM.

+ 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. Command button to save workbook with filename data from 2 cells??
    By Owen1976 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-16-2016, 08:04 AM
  2. Save data from one workbook to another by pressing a command button
    By SpeckM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-29-2015, 10:22 AM
  3. Open/Save/Close Workbook via command button
    By nathan0519 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2015, 11:24 PM
  4. Marcto to copy sheets from one workbook to a master sheet, for all files in folder
    By crombieguy91 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2013, 11:12 AM
  5. [SOLVED] command button: specified sheet copy and save as new workbook to specified location
    By Zlatko.Pan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2013, 12:28 PM
  6. Command button - to copy active sheet and not save current workbook
    By vjboaz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2008, 05:23 PM
  7. Save workbook via Command Button????
    By Chris Watson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2006, 06:15 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