+ Reply to Thread
Results 1 to 9 of 9

open the csv file and merge them into sheet

  1. #1
    Forum Contributor
    Join Date
    12-29-2014
    Location
    Indonesia
    MS-Off Ver
    Office 2010, 2013
    Posts
    125

    open the csv file and merge them into sheet

    Hi all member forum.
    I worked in one of the main private banks in my country,I want to use excel macro to simplify my work, because I am still learning about this Excel VBA, I want to ask something :
    1. How and what yah VBA syntax we use if we want to process the data from csv file and line number of the file exceeds the capacity Ms.Excel (more than 1,500,000). I want to break down the contents of the file into multiple sheets. to the number of rows excel currently 1,048,576, now my data exceeds the number of rows. I want to move the rest of the excess data sheet to the next row in another sheet (using macros). please enlightenment ...

    2. How and what VBA syntax we can use if we want to process the data from csv file where there are multiple csv files (each file has a number of different lines) and the files we will combine into 1 in the excel sheet. exmple : I have 3 csv files, three files I want to combine into one sheet in Excel using macros.

    please anyone can help me to this case..
    thank you.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: open the csv file and merge them into sheet

    1) Here is a link to a free utility you can use to split any text/csv file into smaller files, manageable in Excel.
    http://www.fxfisherman.com/forums/fo...csv-files.html

    2) Here is a link to a macro that will import all the CSV files in a single folder into an Excel workbook putting each imported csv on a sheet of its own in the workbook:
    https://sites.google.com/a/madrocket...csvs-to-sheets
    Last edited by JBeaucaire; 12-26-2019 at 04:22 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    12-29-2014
    Location
    Indonesia
    MS-Off Ver
    Office 2010, 2013
    Posts
    125

    Re: open the csv file and merge them into sheet

    Hi JBeaucaire,
    thank you for your enlightenment. i'll learn n try from that link from your post. i hope, more expert with macro after this. thank you

  4. #4
    Forum Contributor
    Join Date
    12-29-2014
    Location
    Indonesia
    MS-Off Ver
    Office 2010, 2013
    Posts
    125

    Re: open the csv file and merge them into sheet

    I've followed your advice as above, for free utility to split a csv file that column so much can already do well. Then, for the macro code related to open the csv file (csv import file) and put it into a sheet in the workbook can also be done (macro code can run well), but the macro code can work well if its csv file limited by "comma" (separated by coma). If the csv file it in the limit with the "~" (no comma), then the macro code is still running but the results are not as desired (the result of irregular data columns), whether there should I add to the macro code? Please advise and help again. many thanks

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: open the csv file and merge them into sheet

    So your file is not a CSV. It's a text file. I guess I'd have to see a couple of them to know what to suggest.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  6. #6
    Forum Contributor
    Join Date
    12-29-2014
    Location
    Indonesia
    MS-Off Ver
    Office 2010, 2013
    Posts
    125

    Re: open the csv file and merge them into sheet

    Hi JBeaucaire

    sample csv file (2 file) already inserted in this thread . would you inform me about this case? thank you for your attention and suggestion
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-29-2014
    Location
    Indonesia
    MS-Off Ver
    Office 2010, 2013
    Posts
    125

    Re: open the csv file and merge them into sheet

    Hi JBeaucaire

    my sample workbook is delimiter or sparated by " ~ " (no comma or sapce). please kindly help. thank yo

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: open the csv file and merge them into sheet

    Here's the 2nd macro with a line added to split the imported data using the TextToColumns function of the Data tab. Notice the "array()" entries? Each one tells Excel how to interpret each incoming field.

    1=General, do what appears correct
    2=Treat as Text
    3=Treat as Date

    For now only array items 6 & 7 are treated as dates, items 12 & 13 are specifically treated as text. The rest are General. You can edit those as needed if you spot odd display results in your output.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-29-2014
    Location
    Indonesia
    MS-Off Ver
    Office 2010, 2013
    Posts
    125

    Re: open the csv file and merge them into sheet

    I'm sorry for late reply,
    I've been using macro code from you as above, and can run well. Thank you for your help, you are very expert in such matters. Thank you once again J.
    please kindly guidance me again if later I have more questions.
    greetings
    Dolphino

+ 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. Open Word mail merge file from excel button
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2014, 08:18 PM
  2. Automatically open a file in a specific file path when another sheet is opened
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2014, 11:05 AM
  3. Open every file in the folder, remove merge and wrap, save and close files
    By abdesai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2013, 04:58 PM
  4. Replies: 5
    Last Post: 01-09-2013, 04:06 AM
  5. Replies: 5
    Last Post: 09-29-2012, 12:40 PM

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