+ Reply to Thread
Results 1 to 7 of 7

Splitting data into multiple tabs

  1. #1
    Registered User
    Join Date
    12-16-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    Splitting data into multiple tabs

    Hi

    have a large sheet of data (500k rows) with week ending dates in column A. I need a macro that will split that data into a tab for each week ending date and rename the sheet with the relevant week ending date.

    Have seen a few macros out there but can't seem to get them to work.

    Can anyone help me?

    small sample attached now

    Edit: It was brought to my attention that this attachment may have contained sensitive information. It has been removed. Please make sure to scrub what you attach clean of confidential info and re-post it.
    Last edited by NBVC; 12-16-2011 at 10:29 AM. Reason: attachement removed

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

    Re: Splitting data into multiple tabs

    It will be good if you attach a sample workbook and we can assist you easily.
    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
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Splitting data into multiple tabs

    Give this a whirl

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-16-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Splitting data into multiple tabs

    Thanks for this, but when I run it nothing happens, do i need to name the worksheet a specific name? Have attached some sample data in the format of the report. Note that the data is made up and not sensitive so please dont report or remove..thanks!

    John
    Attached Files Attached Files
    Last edited by jadams0550; 12-21-2011 at 09:44 AM.

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Splitting data into multiple tabs

    Perhaps this works for you?

    To test it run the macro "Split_Date".

    Alf
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-16-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Splitting data into multiple tabs

    Thanks very much, initally looks promising however when I run it on my larger sheet it loops endlessly creating several hundred tabs. it creates the initial tabs for my weekending dates really easily but then just keeps running.

    Any ideas how to make it stop doing this?

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Splitting data into multiple tabs

    when I run it on my larger sheet it loops endlessly creating several hundred tab
    Sorry, my bad. Rereading your request I see that you wanted a tab for each week and not one for every day.

    Try this file and see if it works better for you.

    Not to happy with the excel function “WEEKNUM” as it does not give the same result as my Swedish calendar.

    WEEKNUM comes in 2 flavors

    formula =WEEKNUM(Serial_num, 2) Weeks begin on Monday
    formula = WEEKNUM(Serial_num, 1) Weeks begin on Sunday

    I do assume that you want the weeks beginning on Monday, if not so change appropriate line in macro.

    If your data spans over several years you should perhaps consider using the "MONTH" function instead of "WEEKNUM" this would reduce the number of tabs with a factor of four.

    Alf
    Attached Files Attached Files

+ 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