+ Reply to Thread
Results 1 to 18 of 18

Split Data of column into multiple

  1. #1
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Lightbulb Split Data of column into multiple

    Hello

    I want to split data of attached excel file into Multiple workbooks with Macro based on ITEM1 records (unique records - 27 Unique items are available)
    All the data is available in Data Sheet and as a sample Expected Result of "B" is available in result sheets

    Steps are as under
    Step1: First Filter B in Item2 and Paste on New Excel File and it will be saved with the name of B
    Step2: Now Filter B in Item1 and Exclude B from Item2 and Paste Filtered Data without header in Newly Created Workbook with the Name of B
    Step3: If Nothing found in Step 2 - Item2 after excluding then Ignore the Error and split the other

    Alternate Approach
    If the things cant be done like this for unique records split then We can set a cell where we input a item and the data split based upon that criteria but all the steps will remain same as available above

    EDIT:
    Sample Data 2 is available in post#14 and its the same data but the difference is column C and D have numbers instead if Text
    Attached Files Attached Files
    Last edited by vikas_newports; 09-26-2021 at 11:56 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,035

    Re: Split Data of column into multiple

    Instead of a VBA solution, here is a Power Query Solution. You can select the letter you wish to filter on by selecting and then clicking on Refresh All
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    Thanks Alan, but I want to use vba , no doubt power query is powerful option
    I checked the attached power query solution which is not as expected as it should be for example for B there are 299 records but as per your solution here is 298
    and further I checked it with criteria T and again not matching
    Last edited by AliGW; 09-26-2021 at 11:53 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,035

    Re: Split Data of column into multiple

    Ok. Good Luck. But i don't understand your comment about T. I got 261 results. Case Sensitive????
    Last edited by alansidman; 09-25-2021 at 12:35 AM.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,681

    Re: Split Data of column into multiple

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    Quote Originally Posted by alansidman View Post
    Ok. Good Luck. But i don't understand your comment about T. I got 261 results. Case Sensitive????
    No it is not case sensitive , If I filter T then I got 264 records.
    first filter T in item2
    then filter T in item1 and in item2 select only records other than T

  7. #7
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    Quote Originally Posted by jindon View Post
    Please Login or Register  to view this content.
    Thanks Jindon its working fine on sample data and confirm you after implementation in original data

  8. #8
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    @Jindon
    I am getting error because in my Original data the columns are changed
    Column C is Column G in actual data
    Column D is Column I in actual Data

  9. #9
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324
    I managed to change the code as per my original data and it is not working because data is numbers and in example I showed the alphabates , earlier your code was working fine but as I change the sample data with numbers in column c and d it stopped working
    Last edited by AliGW; 09-26-2021 at 11:54 AM. Reason: PLEASE don't quote unnecessarily!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,150

    Re: Split Data of column into multiple

    Why would you provide sample data that contains text values when you know that the real data contains numbers? That's really careless on your part and is tantamount to wasting your helpers' time.

    Please make an effort to provide realistic sample data in future and don't shift the goalposts in this way. Members craft solutions based on what you tell them: they cannot account for what they don't know.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  11. #11
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324
    I agree with you but there was 2 sanrios/situation based on same data, for sample data 1 it is working fine , as I tried it with sample data 2 which has numbers it is not working , and yes I did not shared the sample data 2 bacause I thought both data are same just the difference is alphabates n numbers
    Last edited by AliGW; 09-26-2021 at 11:40 AM. Reason: PLEASE don't quote unnecessarily!

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,150

    Re: Split Data of column into multiple

    But text values and numerical values are COMPLETELY DIFFERENT.

    At the very least you should have advised at the outset that the solution would need to cope with either text or numbers in those columns.

    Please try to give this sort of information at the outset in future. Thanks.

  13. #13
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    Thank you i will mention it in future as I understand it now
    anyways I am posting the sample data 2 Might be I get helped
    Last edited by AliGW; 09-26-2021 at 11:53 AM. Reason: PLEASE don't quote unnecessarily!

  14. #14
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    I was on mistake by assuming same data type because my both sample are same with just the difference of Text and numbers in attached file
    the text version solution available in post#5 and now the same data is attached but this time here are numbers in C and D columns

    Steps are as under
    Step1: First Filter 9002 in Item2 and Paste on New Excel File and it will be saved with the name of 9002
    Step2: Now Filter 9002 in Item1 and Exclude 9002 from Item2 and Paste Filtered Data without header in Newly Created Workbook with the Name of 9002
    Step3: If Nothing found in Step 2 - Item2 after excluding then Ignore the Error and split the other
    Attached Files Attached Files

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,150

    Re: Split Data of column into multiple

    Yes, I think you need to post a new set of sample data.

    Administrative Note:

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below or the REPLY button instead of REPLY WITH QUOTE.
    Last edited by AliGW; 09-26-2021 at 11:57 AM.

  16. #16
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    @AliGW , yes sample data 2 is available now in Post # 14

  17. #17
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,681

    Re: Split Data of column into multiple

    Change
    1)
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    2)
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  18. #18
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Split Data of column into multiple

    Thanks Jindon, its working fine.

+ 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. Split Single Row into multiple rows based on column data
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-29-2017, 01:57 PM
  2. [SOLVED] Need vba to split data into multiple worksheets based on column of P & save wb with FY 16
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2016, 05:47 AM
  3. Split Data From Single Column Set Into Multiple Column Sets?
    By slavrenz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-25-2014, 04:33 AM
  4. split the cell data(multiple data) into column
    By sundarmanik in forum Excel General
    Replies: 10
    Last Post: 07-07-2014, 08:31 AM
  5. Split data in a column into multiple columns in excel vba
    By bujji1305 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-21-2012, 09:10 AM
  6. [SOLVED] Split data in to multiple tabs using value in column
    By Manpar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2012, 08:33 AM
  7. Want to split the data in single cell to multiple column
    By pradeepdeepu_001 in forum Excel General
    Replies: 4
    Last Post: 02-02-2010, 09:11 AM

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