+ Reply to Thread
Results 1 to 3 of 3

How to split a single CSV to multiple ones using different headers in the end results

  1. #1
    Registered User
    Join Date
    03-13-2011
    Location
    Earth
    MS-Off Ver
    Excel 2007
    Posts
    17

    How to split a single CSV to multiple ones using different headers in the end results

    I have this problem one of my clients wants me to split a spreadsheet I have been sending him for a long time into 3 separate sheets, that is

    I regularly sent a file called A.csv with headers head1, head2, head 3, head4 ..... head25

    Now he needs instead of just the A.csv file

    B.csv head1, head14
    C.csv head4, head5, head6, head7, head10
    D.csv head3, head14,head15
    (This is just an example, no relation with the real one, but the method to solve this should be the same)
    In fact I need just to copy the columns and split the original sheet into the 3 separate ones, using just the columns he wants for each case. I have no clue about how to do this, the thing is I tried concatenating all into a single column with separated values, but I have some cells that have commas in the content, so I am open to suggestions. Another problem is the fact that the CSVs are really long sometimes 10s of thousands of products. I know programming, but what I never did is to program within Excel, so I don't know the syntax nor the commands.
    Last edited by ic3cold; 08-27-2013 at 05:33 PM.

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

    Re: Best way to do this, a script, or just functions will do?

    You could try this.

    Please Login or Register  to view this content.
    Last edited by alansidman; 08-26-2013 at 11:40 PM.
    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
    Registered User
    Join Date
    03-13-2011
    Location
    Earth
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: How to split a single CSV to multiple ones using different headers in the end results

    ok here's what I got so far, my problem is I don't know how can I use this in multiple sheets, what I mean is I have many csv files, over 100, so right now I need to apply the macro to each one, is there a way to read the original file name so my sheets are named xxx-12345.csv, where xxx is any name with different lengths.

    Please Login or Register  to view this content.
    Please note I need to add another sub plus so far I am just copying data in the same workbook, the end result, should be 3 separate csv files, one subroutine needs a function or a method to do this >>>

    my source column looks like

    Vehicle Warning Note
    Cat Back Exhaust, Piping: 2.5", Tip: 1 Brushed Stainless, Tip Size: 2.5"

    I need to output that in another sheet this way >>>

    Part Number Attribute Name Attribute Value

    600-0100 Piping 2.5"
    600-0100 Tip 1 Brushed Stainless
    600-0100 Tip Size 2.5"

    I have another column called part number, but I need to split what's on warning note into the 3 or more separate rows duplicating the part number or leaving it blank so there are no confusions. Please note I didn't write that sub yet, the other two in the code section are working except for saving the each sheet to a separate one.
    Last edited by ic3cold; 09-01-2013 at 07:44 PM.

+ 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. Integrating Mainframe emulator script with excel's vba script
    By Himanshu Mishra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 10:30 AM
  2. Chart script functions, but adds unnecessary series.
    By jordan.mcleod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2012, 12:29 PM
  3. macro script for IF & print functions
    By rhua5436 in forum Excel General
    Replies: 6
    Last Post: 04-14-2011, 11:11 AM
  4. Create VBA script to short, dedicated button in excel for script?
    By realized in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2009, 11:54 PM
  5. Script that edits the text printed on the button that runs the script
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2008, 02:41 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