+ Reply to Thread
Results 1 to 19 of 19

Create new tabs (or files) from data

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    Lake Wales, Florida
    MS-Off Ver
    Excel 2016 (365)
    Posts
    10

    Create new tabs (or files) from data

    I have a file with approx. 82,000 (varies by week) rows and 40 named columns. There are 65 unique districts identified in the data. My ideal scenario would be to automate the function of creating new files segregated by the unique districts. In other words 65 files (or tabs if unique individual files are not attainable), each containing the rows for each district.
    Thank You.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Create new tabs (or files) from data


    Both are possible just using Excel basics like for example an easy advanced filter
    so at least just well explain what you expect for,
    and that's better with an attachment containing a source workbook and an expected result workbook …

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Create new tabs (or files) from data

    Hi Allan,

    Before you split your data up into different tabs, learn about AutoFilter to see if it does what you need first. Select any cell in your data and click on the Data Tab and then on the Filter Icon. This creates dropdowns across the top row. (You should really have column titles across the top row). Click the dropdown for districts and filter ALL the data to only show that district.

    If AutoFilter is too hard to handle then Advanced Filters might be better for you. Learn about those too, as they could easily lead you to your separate tabs solution. Simply put the criteria on a separate tab and refresh all to split your data between new tabs.

    Time to learn Advanced Filter?

    See if the below site helps.
    https://www.extendoffice.com/documen...her-sheet.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create new tabs (or files) from data

    District is column "D" ?
    There is no header ??
    - Battle without fear gives no glory - Just try

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Create new tabs (or files) from data


    As an advanced filter needs only a single codeline to filter and copy data to the destination …

    But whatever filtering or advanced filtering like any Excel beginner can operate manually,
    it can't be possible without a headers top row (respecting Excel spirit).

  6. #6
    Registered User
    Join Date
    04-14-2014
    Location
    Lake Wales, Florida
    MS-Off Ver
    Excel 2016 (365)
    Posts
    10

    Re: Create new tabs (or files) from data

    Yes, column D is the district. Sorry for the omission of the headers in the example.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Well reading is the way for a solution …


    As I wrote :

    Quote Originally Posted by Marc L View Post
    […] and that's better with an attachment containing a source workbook
    and an expected result workbook …
    Both smart enough, with headers …

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create new tabs (or files) from data

    See next code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-14-2014
    Location
    Lake Wales, Florida
    MS-Off Ver
    Excel 2016 (365)
    Posts
    10

    Re: Create new tabs (or files) from data

    Thank You very much.

  10. #10
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create new tabs (or files) from data

    You're welcome.
    Glad to help

  11. #11
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Create new tabs (or files) from data


    PCI, SpecialCells for visible cells is useless as the Range.Copy method takes care only of visible cells …

  12. #12
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create new tabs (or files) from data

    @Marc
    SpecialCells for visible cells is useless as the Range.Copy method takes care only of visible cells …
    Yes, thank you, an old habit, it's time to change

  13. #13
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create new tabs (or files) from data

    An update
    See at the end
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    04-14-2014
    Location
    Lake Wales, Florida
    MS-Off Ver
    Excel 2016 (365)
    Posts
    10

    Re: Create new tabs (or files) from data

    Thank You. The code has worked great.
    That being said, is it possible to add additional code that would "Autofit Column Width" as the new files are created?

  15. #15
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Create new tabs (or files) from data

    or
    Please Login or Register  to view this content.

  16. #16
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create new tabs (or files) from data

    See here after
    Please Login or Register  to view this content.

  17. #17
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Create new tabs (or files) from data

    Still shorter and faster

    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    04-14-2014
    Location
    Lake Wales, Florida
    MS-Off Ver
    Excel 2016 (365)
    Posts
    10

    Re: Create new tabs (or files) from data

    Thank you very much.

  19. #19
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Create new tabs (or files) from data

    You're welcome

+ 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. combining data from 2 tabs to create records?
    By ciapul12 in forum Excel General
    Replies: 5
    Last Post: 09-30-2018, 04:16 AM
  2. create tabs from list/add data to worksheet
    By adampom in forum Excel General
    Replies: 2
    Last Post: 10-27-2016, 06:33 PM
  3. [SOLVED] Create Multiple Tabs When Data Varies With Macro/VBA
    By Excel4444 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-29-2016, 08:26 PM
  4. Replies: 2
    Last Post: 08-18-2014, 08:39 PM
  5. Need to prepare recap file by pulling data from numerous tabs/files
    By adiarudyk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-03-2013, 01:48 AM
  6. VB Code to Consolidate data from different files / tabs
    By tt388 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-29-2011, 11:53 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