+ Reply to Thread
Results 1 to 5 of 5

Macro to create new worksheets based on column values in a sheet

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Macro to create new worksheets based on column values in a sheet

    Hi, I'm trying to convert a time sheet report in excel to individual reports per user and project. I've attached the base report below. Basically, I want to create a worksheet per new value in the "Project" column (A) and also add worksheets for each change in the "Created by" column (E).
    The resulting sheets would each contain all time transactions for that specific value.
    Another option might be to create separate files for each variation with the column value + the current date being the file name.

    I tried the following which I copied form another post and does most of the job, but it fails when the data isn't sorted correctly (only includes first values found and tries to create a duplicate sheet):

    Please Login or Register  to view this content.
    As a last resort, I can add a sort statement and repeat the subroutine for the "created by" column, but I'm hoping for a cleaner solution.
    Attached Files Attached Files
    Last edited by jeffreybrown; 11-01-2012 at 07:39 PM. Reason: Please use code tags...Thanks.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro to create new worksheets based on column values in a sheet

    Hi

    Here goes

    Please Login or Register  to view this content.
    rylo

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro to create new worksheets based on column values in a sheet

    This adds a sheet and names it for each unique value in column A

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-01-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to create new worksheets based on column values in a sheet

    Wow, thanks a lot Rylo. That's exactly what I was after.

  5. #5
    Registered User
    Join Date
    11-01-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to create new worksheets based on column values in a sheet

    Thanks AlphaFrog, nice efficient bit of code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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