Results 1 to 8 of 8

Thread: Automated Excel File Creation with VBA

  1. #1
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    12

    Automated Excel File Creation with VBA

    Hi Guys,

    I would like to know if its possible to create a command button to create a new excel file.
    I have a voucher generator excel file, which generates vouchers on each sheet. So at the end of each month, i would like to create a new excel file for the next month with just the first two sheets of the 100+ worksheets in the new excel file. This would be helful as i have over 50 such files which need to be renamed and modified each month. It would be nice if the command button would ask me to name the file before creating it.

    I would like to modify 3-4 cells in this workbook, but will mention them only if the above mentioned is possible.
    I am attaching the template file for your reference.


    Regards,
    Siyab
    Attached Files Attached Files

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi

    Save the workbook as Excel Macro-Enabled Template with the required two sheets. Now for each month open the template (which opens a copy of the template) and save as workbook.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    12
    Thanks for the easy solution. I can use this for different files I have. But not for the 50+ files which needs modifications each month.

    Let me explain the modifications. P.S. I am giving the example of what changes i require while changing from June 2013 to July 2013.
    'Summary' sheet changes:
    - A1 changes to "GENERAL MAINTENANCE VOUCHER SUMMARY - JULY 2013" from JUNE 2013 and so on each month.
    - A3:A150 need to replace -06- with -07- (06 = June & 07 = July). So the July 2013 file will have GM-07-0001 and so on.

    'Format' sheet changes:
    - By the end of each month, cell J8 will have reached GM-06-0100+/-. SO when the new excel is generated, the value in J8 should be replaced to GM-07-0000 (not 0001)

    Now, you see I have to do this manually for 50+ files each month. So any suggestion or help will be highly appreciated.

  4. #4
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    Hi

    Please find attached the Template. I hope this will find useful.
    Attached Files Attached Files
    Last edited by Admin; 07-03-2013 at 11:20 PM.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  5. #5
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    12
    Wow!! Thats just amazing work.

    I tried 2-3 files from home and it worked really good. Will go to office tomorrow and check this with other files.

    Thanks again.

  6. #6
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    You are welcome. Glad you liked it
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  7. #7
    Member
    Join Date
    Jun 2012
    Posts
    80
    Rep Power
    12
    Sorry to be a trouble to you!!
    But theres a teensy-weensy problem with the file.

    When you enter the wrong date and the error screen appears "Do you want to try again?". If i click Ok, the "workbook closing" error appears and closes the workbook

    Help please!

  8. #8
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,122
    Rep Power
    10
    I have uploaded the correct file. Download it and try again.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Replies: 17
    Last Post: 07-15-2013, 09:56 PM
  2. Excel VBA Macro To Open A File Through Browse Dialog Box
    By Safal Shrestha in forum Excel Help
    Replies: 2
    Last Post: 04-05-2013, 12:59 PM
  3. Save Excel 2010 File In CSV Format VBA
    By mag in forum Excel Help
    Replies: 7
    Last Post: 01-08-2013, 07:16 PM
  4. Import text file to an Excel file
    By obed_cruz in forum Excel Help
    Replies: 5
    Last Post: 08-03-2011, 07:58 PM
  5. Replies: 1
    Last Post: 06-02-2011, 10:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •