+ Reply to Thread
Results 1 to 3 of 3

Combining macro in two .xlsx and making the macro create a third .xlsx

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007/2010
    Posts
    2

    Combining macro in two .xlsx and making the macro create a third .xlsx

    Hello!

    Yes, I am new to this but I know how to record macro, so I will formost ask if this is technically possible and if it is, where can I learn how to write macro that is this advanced?



    I have two .xlsx files. Lets call them WS1 and WS2.
    WS1 is only a template. WS2 is where all the data is stored and altered.

    I would like my macro to;
    §1 Create a new .xlsx file in a sub folder, named after the cell A2 in WS2, that is a copy of WS1.
    §2 Create a new file according to §1 for every row in WS2 that has the same year specified in column C as the present year, ie 2012, 2013 etc...
    §3 Copy a series of values from WS2 in a row consistent to each newly created .xlsx.
    §4 Copy all created files to a new folder named after the present year, ie 2012
    §5 When the year value in column C is <Present year, ie 2011, 2010 etc, it should first copy that value to column B, then add value according to column D to column C. Ie, column C is always present year or future, column B is always the past. Column D defines intervalls.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Combining macro in two .xlsx and making the macro create a third .xlsx

    Do you have a sample file that you can upload?


    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2007/2010
    Posts
    2

    Re: Combining macro in two .xlsx and making the macro create a third .xlsx

    Of course!

    Sam.xlsx
    Mall.xlsx

    I will repost the first post with the correct cell names.
    Excuse the swedish language.
    I have two .xlsx files. Lets call them MALL and SAM.
    MALL is only a template. SAM is where all the data is stored and altered.

    I would like my macro to;
    §1 Create a new .xlsx file in a sub folder, named after the value in corresponding row and column K in SAM, that is a copy of MALL.
    §2 Create a new file according to §1 for every row in SAM that has the same year specified in column M as the present year, ie 2012, 2013 etc...
    §3 Copy a series of values from SAM in a row consistent to each newly created .xlsx.
    §4 Copy all created files to a new folder named after the present year, ie 2012
    §5 When the year value in column M is <Present year, ie 2011, 2010 etc, it should first copy that value to column I, then add value according to column J to column M. Ie, column C is always present year or future, column B is always the past. Column D defines intervalls.

    Also note that the SAM.xlsx is far from complete.

    Thanks a bunch!!!!1

+ 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