+ Reply to Thread
Results 1 to 6 of 6

Macro for creating new workbooks based on unique cell value

  1. #1
    Registered User
    Join Date
    03-07-2017
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    4

    Macro for creating new workbooks based on unique cell value

    Dear all,

    I am curious if there is a macro that would do the following :

    Locate matching cell data within a colomn (A), copy all rows that have a match with that cell and create a new workbook for those specific rows, concerning coloms A to H.
    If possible i would also like to set the name for the new workbook to be based on cell from colomn B, and if possible specify the folder where they need to be created.

    Imagine you have a mass extraction of balance sheets from your customer database containing 80 clients, each with their own specific details.
    Colomn A to H, where A would be the criteria to copy to a new workbook (customer number) and B would be the name of that new workbook (customer name), colomns C to H contain unique data.

    Location could be Desktop/MassExctraction

    The macro would create 80 workbooks within the folder, name of the workbook would be matching with the customer name and the workbook would only contain customer specific data.

    Looking forward to hear from you !

    KR

    Marcel


  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Macro for creating new workbooks based on unique cell value

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.




    To add a file to a post

  3. #3
    Registered User
    Join Date
    03-07-2017
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro for creating new workbooks based on unique cell value

    Hi Dave,

    Thanks for the reply, i cant really attach anything because of private info. My description is pretty clear though?

    If something is not clear please let me know

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Macro for creating new workbooks based on unique cell value

    It's called a sample workbook for a reason.

    Your description may be clear, but are you expecting somebody to recreate the workbook when you have it made already?

  5. #5
    Registered User
    Join Date
    03-07-2017
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro for creating new workbooks based on unique cell value

    No i would just need the macro
    But np ill try to provide a sample

  6. #6
    Registered User
    Join Date
    03-07-2017
    Location
    Netherlands
    MS-Off Ver
    2010
    Posts
    4

    Thumbs up Re: Macro for creating new workbooks based on unique cell value

    i have made a sample but unable to attach (icon won't work)

    So basically i will describe it in the most simple way :

    I want the macro to create new workbooks for each unique value within colom A.
    Colom A would be the customer name, so if customer names are Customer 1, 2 etc. to 5, the macro should create 5 workbooks.

    Each workbook would be named in accordance to value of Colom A, so customer 1, customer 2, customer 3, customer 4, customer 5.

    In the new workbooks, all data should be placed of any other colomns that contain data in the original file in which the macro was run, based on colom A.
    So if in the mail file customer 3 appears 10 times in colom A, with values in the other colomns, than new workbook for customer 3 would contain 10 lines resembling the data as mentioned in the original file.

    As i would like to apply this macro to all kinds of data and also future data, i prefer that it is created for all coloms and rows, to avoid some not being copied based on set restrictions.

    Basically the thought behind is that if you have a massive customer database, the macro would create a workbook for each customer containing the data from the orginal file for only that customer.

    Hope this is a bit clear now.

+ 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. Creating a Macro which inputs # of rows based on cell value
    By ngosselin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-28-2015, 03:00 PM
  2. Replies: 1
    Last Post: 05-20-2015, 04:27 PM
  3. Macro for creating new sheets based on unique values in a row...
    By Cuda1337 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-05-2014, 09:02 PM
  4. macro to download file into unique folder based on cell value
    By mlicurse in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2014, 01:25 PM
  5. Macro to copy data from other workbooks based on cell value
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-16-2013, 12:53 AM
  6. Help on Auto-Mailing Extracted Workbooks Based Upon Unique Filter
    By Parijaat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-18-2013, 06:16 AM
  7. Create Workbooks based on Unique Values from a Column
    By aravindhan_31 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 04: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