+ Reply to Thread
Results 1 to 3 of 3

Creating n number of worksheets based on userform input

  1. #1
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Creating n number of worksheets based on userform input

    Hello

    As part of my project I have a master worksheet and an 'n' number of worksheets that people will use for data entry. That way I don't need to give anyone access to the master worksheet. Currently the macro creates two worksheets in the workbook (one master copy and one copy for distribution). The distribution copy is different structurally than the master worksheet and that's why it has its own worksheet.

    (1) What I would like help doing is creating a macro that would open a userform asking for the 'number of copies for distribution' and create new workbooks with that number provided by the user.

    (2) Once the workbooks are created, close each one prompting for a file name and a location to save them.

    Thanks in advance.

    abousetta
    Last edited by abousetta; 05-07-2010 at 02:04 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Creating n number of worksheets based on userform input

    Give this a try. Adjust the sheet name per your needs. The sheet name used is the code name not the worksheet name in the tab.

    Please Login or Register  to view this content.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Creating n number of worksheets based on userform input

    Thank you so much. It works like a charm.

    I studies your approach and made my tweeks and it runs well for my purposes now. I just have one question. I have replaced the original command

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    just to allow me to specify the default file type. I am using Excel 2007 and if I try to make the default file type anything but *.xlsx, even though it will save the file, it gives me a warning when every time I come to open the newly saved files. The warning states that the file you are trying to open is a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source...

    Is a better way to save the files?

    Thanks for everything.

    abousetta

    P.S. My modified code is below:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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