+ Reply to Thread
Results 1 to 20 of 20

Automatically make new excel-files (and save in specific folder on my computer)

  1. #1
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Automatically make new excel-files (and save in specific folder on my computer)

    Example data.xlsxCan someone help me with a good VBA-code for underlying problem?

    I have to save a lot of excel-files with different names. (about 100)
    I need a macro to automatically save excel-files with different names in a specific folder on my computer.

    See attachment.

    The name of the files should contain the combination of column G and H. (for example "1206 - Praktijkhuisman.xlsx")
    He should make a new file when there is an other unique value in Column G.


    After making a new excelfile he should copy the data (include layout) in a tab (with same name as the new excel file) from column A t/m L.
    Only the data for the Unique value in Column G.

    Please can someone help me??
    Attached Images Attached Images
    Last edited by Josvanderwaaij; 08-20-2014 at 06:03 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Hi..

    Attaching an image might help you if this was a photoshop forum..

    Best to attach an excel file showing raw data and desired result.

  4. #4
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Thanks for your advice.

    I attached a file with raw data.

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Hi..

    Only the data for the Unique value in Column G.
    So.. as an example.. would that mean that the first file would be called '1206 - Praktijkhuisman.xlsx' and it should have a sheet called the same name and on that sheet would be the data from A2:L5?

    And second file would be called '205 - De Hoeksteen.xlsx'. having a sheet in it called the same and data would be from A6:L6?

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Yes, that is correct! It would save me a lot of time.

  8. #8
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Thanks so far.

    Couple of problems.

    1. add new workbooks with names is working correctly
    - only he makes also a lot of new maps without a name and didn't close those new maps.

    2. He didn't name the sheet the same as the workbook and he didn't copy the values in the sheet.

    Can you help me? I still have to learn a lot about VBA.

  9. #9
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Knipsel.JPG
    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    I get also message with this error (see attachement)
    Fould 9 - Subscript is out of range

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Try:

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Unfortunalety still not working correct.

    Still same problems.

    1. add new workbooks with names is working correctly
    - only he makes also a lot of new maps (for each row have makes a new map) without a name and didn't close those new maps.

    2. He didn't name the sheet the same as the workbook and he didn't copy the values in the sheet.

    3. How can I change the folderdestation (for example H:\Test\ ....

    4. Still message with fould 9, subscript is out of range.

    Hope you have time to look into this?

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    It worked for me when I tested it on your attachment? I can't duplicate your error.

  13. #13
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Strange , thanks for your quick help. Maybe someone else can create a code on a different way.
    I gonna read some books about vba , to understand the codes better. Do you have good tips for sites??

  14. #14
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    I think there may be a Language version issue based on the error you were getting.

  15. #15
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Alot of learning materials are listed here.

    http://www.excelforum.com/excel-prog...materials.html

  16. #16
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Quote Originally Posted by Josvanderwaaij View Post
    Unfortunalety still not working correct.

    Still same problems.

    1. add new workbooks with names is working correctly
    - only he makes also a lot of new maps (for each row have makes a new map) without a name and didn't close those new maps.

    2. He didn't name the sheet the same as the workbook and he didn't copy the values in the sheet.

    3. How can I change the folderdestation (for example H:\Test\ ....

    4. Still message with fould 9, subscript is out of range.

    Hope you have time to look into this?
    If you create a new workbook without doing anything else, what is the default name of the new workbook?

  17. #17
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Quote Originally Posted by JOHN H. DAVIS View Post
    If you create a new workbook without doing anything else, what is the default name of the new workbook?
    I don't know what you mean??
    Do you mean the name of the excel-file?? Than is the name map1 , map2, etc.

  18. #18
    Registered User
    Join Date
    08-20-2014
    Location
    Assen, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Quote Originally Posted by JOHN H. DAVIS View Post
    I think there may be a Language version issue based on the error you were getting.
    I run the macro at home and than it is working almost correctly.
    At home a have a English version of excel and at work a dutch version. So you are correct that's a issues with language.
    But i don't know which parameter is different in dutch version.

    I am very happy with your Help.

    Can you help with little adjustment.

    After coyping the information into the different workbooks, the workbook isn't save automatically and didn't close automatically. Is this possible to change?

  19. #19
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Based on the posts try this on the Dutch version. Although trial and error may not be the best way to decipher a different language.

    Please Login or Register  to view this content.

  20. #20
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Automatically make new excel-files (and save in specific folder on my computer)

    Quote Originally Posted by Josvanderwaaij View Post
    I run the macro at home and than it is working almost correctly.
    At home a have a English version of excel and at work a dutch version. So you are correct that's a issues with language.
    But i don't know which parameter is different in dutch version.

    I am very happy with your Help.

    Can you help with little adjustment.

    After coyping the information into the different workbooks, the workbook isn't save automatically and didn't close automatically. Is this possible to change?
    Try:

    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)

Similar Threads

  1. Replies: 1
    Last Post: 01-28-2019, 06:55 PM
  2. one folder & so many excel files are save, i want name change without open excel files
    By sonu_kumar444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2013, 03:45 PM
  3. Replies: 1
    Last Post: 01-24-2006, 11:35 AM
  4. Replies: 1
    Last Post: 01-24-2006, 11:00 AM
  5. Replies: 1
    Last Post: 01-24-2006, 12:25 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