+ Reply to Thread
Results 1 to 15 of 15

Macro to split worksheet to multiple worksheets

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    68

    Macro to split worksheet to multiple worksheets

    I been trying to write a macro to split a worksheet based on column C to multiple worksheets inn the same workbook. if any one can help i really would apperciate it.
    Last edited by daillest319; 06-13-2012 at 10:11 AM.

  2. #2
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to split worksheet to multiple worksheets

    Try this - assumes headers in row 1

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-09-2012
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Macro to split worksheet to multiple worksheets

    works great with headers but is it possbile to do this if i dont have headers?
    Last edited by daillest319; 06-13-2012 at 09:21 AM.

  4. #4
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to split worksheet to multiple worksheets

    Try this

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-09-2012
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Macro to split worksheet to multiple worksheets

    works perfect thank you...but is there anyway i can have the worksheets named to what there being split...for example equal what column C cell is...like the first code did?

  6. #6
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to split worksheet to multiple worksheets

    Yes, try

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-09-2012
    Location
    here
    MS-Off Ver
    Excel 2003
    Posts
    68

    Re: Macro to split worksheet to multiple worksheets

    thank you so much....works perfect

  8. #8
    Registered User
    Join Date
    12-13-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Macro to split worksheet to multiple worksheets

    I do have a question about this macro. I tested it for my purposes but it seems to keep adding the same worksheet with a new Worksheet name incremented by one even if it already exists from a previous macro run. Is there a way to only add another worksheet if that one does not already exists in the event more data is added to the Master worksheet? So each time it is run it would then clear and replace data that may already be in an existing one and update it with what is currently there?

  9. #9
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to split worksheet to multiple worksheets

    Are there just the Master worksheet and the "child" worksheets created by the macro? Which version are you using - with or without headers?

  10. #10
    Registered User
    Join Date
    12-13-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Macro to split worksheet to multiple worksheets

    Yes I have a Master worksheet and child worksheets with headers and I am using Excel 2010. The child worksheets were created from the first initial run of this macro.

  11. #11
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to split worksheet to multiple worksheets

    Try this

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-13-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Macro to split worksheet to multiple worksheets

    There is a typo with the worhsheets.Name but it still is not an accepted function. I see what you are trying to do but now I am trying to see where and how that logic will fit in the existing code.

  13. #13
    Registered User
    Join Date
    12-13-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Macro to split worksheet to multiple worksheets

    I wonder if I can try an approach looking for the WksExists(being the value of column 1). If it exists then clear the cells and replace with new data ELSE add a new sheet.

  14. #14
    Registered User
    Join Date
    12-13-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Macro to split worksheet to multiple worksheets

    This piece seems to be working in place of the delete part you have:

    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    06-07-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    189

    Re: Macro to split worksheet to multiple worksheets

    Apologies

    Please Login or Register  to view this content.

+ 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