+ Reply to Thread
Results 1 to 21 of 21

Create workbooks from unique values

  1. #1
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Create workbooks from unique values

    Hello everyone
    I have a task that I desperately need to complete so Any help in the correct direction is appreciated.
    I have written the code below to create new workbooks based on column k in master sheet and save them in the path of the active workbook.
    The code works fine but I am having problem in Two points
    first point is how can create new workbooks with the beginning 11 columns and the columns from ED to GL based on the column k
    The second point is how can insert total row to sum for each column in the workbooks created.
    Here is what I currently have in my Module
    Please Login or Register  to view this content.
    Thank you in advanc
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652

    Re: Create workbooks from unique values

    try
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Thank you so much Jindon - this worked.
    What about the second point which is how can insert total row to sum for each column in the workbooks created.
    Thanks again for your support,

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652

    Re: Create workbooks from unique values

    Ahhh,

    try replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Thanks again Jindon! I will check and get back to you.

  6. #6
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,448

    Re: Create workbooks from unique values

    Another Option...
    Please Login or Register  to view this content.
    Last edited by Sintek; 05-10-2024 at 10:15 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  7. #7
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Dear Mr Jindon
    This is great when working with low row numbers, however, I'm now working on a file with 16000 rows and There will be ~40 unique values
    so that means ~40 unique workbooks so the macro is taking very long to process.... Is there a way to make it faster?
    Note : The range I want to sum is in columns L through BT in the workbooks created...... Thank you for your patience.
    Last edited by JACK JOUSH; 05-10-2024 at 09:26 AM.

  8. #8
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Thanks sintek! I will check and get back to you.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652

    Re: Create workbooks from unique values

    See if this runs faster,
    Please Login or Register  to view this content.
    Last edited by jindon; 05-10-2024 at 10:14 AM.

  10. #10
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Dear Mr Jindon
    Note : The range I want to sum is in columns L through BT in the workbooks created .... I will test it again
    You can modify this line of your code
    Please Login or Register  to view this content.
    Thank you for your patience.

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652

    Re: Create workbooks from unique values

    Code in #9 has been edited.

  12. #12
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Thanks Jindon and sintek! Both macros works wonderful! Appreciate your help.
    I have two extra questions to ask:
    1 - How can Add some formats for columns from L to BT like Number Format Etc in the workbooks created.
    2- How can change the row height for this row that contains "Total" to 60 points and the main header in row 1 too to 120 points.
    Thanks a lot for both of you to help me
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652

    Re: Create workbooks from unique values

    So, you are happy to remove hyperlinks in Col.K.
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    I'm not happy to remove hyperlinks in Col.K.... but I'm very very happy for sharing me my issues.
    I am so glad of this perfect solution ... Thank you very much jindon ... You are a true legend...Have a Great Day

  15. #15
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652

    Re: Create workbooks from unique values

    Then need to copy the rows.

    Use whichever faster.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Thank you very much jindon
    I tested it on Another sample about 12000 rows ( Not tested on the original file ) Here's this report
    Sub test() In post #13 = 8 seconds
    Sub testAutoFilter() In post #15 = 17 seconds
    Sub testDic() In post #15 = it is painfully slow it takes about 7 minutes to execute.
    Again my sincere thanks for taking an interest in my problem.

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,652

    Re: Create workbooks from unique values

    Yep, code in #13 uses AdvancedFilter and it is not actually copying the rows (removing hyperlinks etc.), so faster...

  18. #18
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Thanks again jindon for all the great help you offered
    Give me some time to work on the original file and I will tell you about any notes.
    see you tomorrow ... Have a nice time my Professor

  19. #19
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,448

    Re: Create workbooks from unique values

    Quote Originally Posted by JACK JOUSH View Post
    Thanks sintek! I will check and get back to you.
    Just out of curiosity...How long does post 6 run...

  20. #20
    Registered User
    Join Date
    12-10-2020
    Location
    Sweden
    MS-Off Ver
    2010
    Posts
    88

    Re: Create workbooks from unique values

    Thank you very much sintek
    It works well ... it took about 10 seconds
    but I need to som formats in all workbooks Which will be created .... please refer to #post 12
    Again my sincere thanks for taking an interest

  21. #21
    Forum Expert Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,448

    Re: Create workbooks from unique values

    Yes, noticed that...With below comment however, my solution would not work unless hyperlinks were first stored in array & then re-allocated...
    I'm not happy to remove hyperlinks
    As you already had 3 solutions offered by jindon of which best is 8 seconds...No need for further edit...
    Was just curious...Tx

+ 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. Comparison of workbooks and adding unique values to new workbook
    By Abhilash Mukundh in forum Excel General
    Replies: 1
    Last Post: 03-20-2021, 12:21 PM
  2. Create a unique list with a count against the unique values
    By barber87 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-12-2017, 10:13 AM
  3. [SOLVED] highlight unique values between two workbooks
    By MarkFltc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2017, 01:49 PM
  4. Compare and identify unique column values from different workbooks
    By la_chua29 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2015, 12:40 PM
  5. Compare and identify unique values from different workbooks
    By la_chua29 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2015, 01:44 AM
  6. 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