VBA code to split data to seperate tabs based on a change in Column 1

  • Hi


    I have a set of data that I need to separate out to individual tabs.


    I need the data to separate at a change of text in column 1. I also need the tabs to be named after the text they are separating from.


    e.g. column 1 is a list of teaching groups at each change of teaching group I want the data to split to a new tab and name the tab after the Teaching group taking all the data for that group with it using the same column headings.


    I have tried the below but it fails:

  • Re: VBA code to split data to seperate tabs based on a change in Column 1


    Welcome to the Forum.


    Have you read the Forum Rules?


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.
    Please make an immediate edit of your post to add the missing tags. Be sure to use them in future posts.


    [COLOR="navy"]How to use code tags[/COLOR]


    [noparse]

    Code
    [/noparse]
    [COLOR="navy"]your code goes between these tags[/COLOR]
    [noparse]

    [/noparse]


    Or, just highlight all of the code and press the [COLOR="#FF0000"]#[/COLOR] button to add the code tags.


    Thanks.


    Added this time

  • Re: VBA code to split data to seperate tabs based on a change in Column 1


    Huge apologies i wasn't aware of this and thank you very much for adding on this occasion.


    Re: sheet names ok is there a reason these are unusable ?


    thanks again

  • Re: VBA code to split data to seperate tabs based on a change in Column 1


    The "/" character is the culprit..


    Perhaps replace that with a hyphen (-)..


    You could:


    1. Determine the unique values in column A.
    2. Set up a loop and autofilter by each unique value.
    3. Copy the result for each unique value to a new Sheet.


    On a side note.. i find the content of column "I" interesting... the differentiation or association between race colour and nationality..

  • Re: VBA code to split data to seperate tabs based on a change in Column 1


    Many thanks for your help I had a moment of inspiration after I asked the question and removed the / and replaced with a . and the code worked perfectly, thanks for all your help I am a novice at this but am thoroughly enjoying learning and find this Forum a huge source of support.


    I will try your above suggestion just to learn some more new funstionality.


    thanks again

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!