+ Reply to Thread
Results 1 to 10 of 10

Split a list in to separate tabs

  1. #1
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Split a list in to separate tabs

    Hi all,

    I am looking for a method of quickly taking a list with multiple possible entries in a column (say column A) and copying all identical entries to a new tab; naming the new tab whatever the entry initially was.

    That is, if column A has entries including 'bus' (12 times), 'car' (19 times) and 'Jumbo Jet' (113 times), then I'm looking to quickly create new tabs called 'bus', 'car' and 'Jumbo Jet' and within these have only the rows that had those entries in column A.

    I have attached two sample sheets to give a better idea. Take sample 1 as being my initial data and sample 2 as how the result might look.

    Thanks in advance for any help/response.
    Attached Files Attached Files
    Last edited by kiboodez; 12-02-2014 at 11:31 AM.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Split a list in to separate tabs

    Add the following VBA and run it

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Split a list in to separate tabs

    Actually, heres a more elegant solution...

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Split a list in to separate tabs

    Hi there,

    Thank you for the quick response. I tried your solution on the sample files and it works great.

    However, Actual file I am using contains 2000ish rows and some of the names are of the form 'Admin & IT'. Would this cause issues? It is coming up with error 400 when I try it.

    Thanks again for your efforts.

  5. #5
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Split a list in to separate tabs

    "Admin & IT" shouldnt cause a problem however if youve got the likes of Quotation Marks etc then they could cause problems.

    What exactly is the error message given, and if there is a Debug button available, what line is highlighted when you press it?

    Also which of the two solutions are you using?

  6. #6
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Split a list in to separate tabs

    Hi there,

    I have attached a copy of the sheet I'm working with (with sensitive data removed). It might be easier iof you seen the whole thing.

    thanks again.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Split a list in to separate tabs

    The problem comes with names longer than allowed and theres a reserved word (History) in there.


    Please Login or Register  to view this content.
    The amended code above will create the name based on the first 30 chars and append a _ to it to get round the reserved word issue. Theres one final possibility, if you have courses named more than 30 chars long and they are essentially the same but with say Level1, Level2 etc then you're still going to have problems with these.

  8. #8
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Split a list in to separate tabs

    Thanks again for your efforts, it turns out that I am useless!!!

    I'm still getting an error, and have little to no skills in fixing these.

    I have attached a file with the errors, I'm sure you'll make more sense of it than me.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Split a list in to separate tabs

    You havent included the function which was part of the original code. You'll need to paste the following underneath the other Sub

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-28-2008
    Location
    UK
    MS-Off Ver
    MS 365 Apps for Enterprise
    Posts
    64

    Re: Split a list in to separate tabs

    Absolutely outstanding, thank you sincerely for your time and effort.

    Kiboodez

+ 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. Moving multiple excel tabs into separate tabs/separate files
    By RO24 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-02-2014, 11:04 AM
  2. Best option to filter data from one large list to separate tabs
    By DJJAY in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-16-2014, 03:23 PM
  3. Replies: 1
    Last Post: 05-18-2014, 02:12 PM
  4. How Do I split a file into several Tabs, acording to information on other tabs?
    By Edinson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2013, 05:17 AM
  5. [SOLVED] Need to split a LONG list into separate sheets based on repeating, incremental nunbers
    By matrix_machine in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-31-2012, 04:37 PM

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