+ Reply to Thread
Results 1 to 5 of 5

read CSV file and create XLSX file with certain formatting

  1. #1
    Forum Contributor
    Join Date
    02-18-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2016
    Posts
    221

    read CSV file and create XLSX file with certain formatting

    Hello,

    I am look for options how to read a CSV file with a certain structure (see attachment: csv_input.csv) and create a XLSX file from the data in the CSV with a specific formatting (see attachment: result_output.xlsx).

    I'm having different CSV files which will always have the same number of columns, but a different number of rows, so I would want something which considers this. Also, the CSV file has some redundant data in the beginning, which I do not want in the result file. I only want to transfer the data starting from "Datum".

    Some columns have a non-standard formatting (number or percentage - see result_output.xlsx) and special formatting (first row is bold and underlined and there is a line over the last row). Is it possible to include this in the code?

    Thank you very much for your help.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: read CSV file and create XLSX file with certain formatting

    1. Import CSV file ( using Text Import Wizzard)
    2. Insert a row at row 1 (you will copy headings from other file on row 1)
    3. Copy the formatting from Final file (A2:AA2) to the imported data
    4. Clean up some of the fields that don't format correctly (like the dates with decimal points in them, or numbers with multiple decimal points)

    I would start with excel open. Open the file from within excel (File / Open go to the proper folder where the file is saved ~ you may need to change the drop down box for file TYPE to ALL FILES(*.*)....it is next to the File Name in excel. The TEXT WIZZARD should open [you can change the "Start import at row to" 11 ~ If your new info always starts at row 11 as you indicated] , use DELIMITED type, NEXT button, put check mark in COMMA box, Next button again and then FINISH button. This will put the data into its own worksheet. Insert a row at row1. Copy formatting over your imported data.

  3. #3
    Forum Contributor
    Join Date
    02-18-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2016
    Posts
    221

    Re: read CSV file and create XLSX file with certain formatting

    Hi,

    thank you for your suggestion. The problem is that I have to make the whole process (much) easier because the userbase consists of people who are seldom using excel and are also older. That's why I was thinking of an automated VBA solution, where you can start the code through a button. Ideally, the user has to punch just one a button which opens a "Open file"-menu and then VBA takes care of the data transfer and formatting.

  4. #4
    Forum Contributor
    Join Date
    02-18-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2016
    Posts
    221

    Re: read CSV file and create XLSX file with certain formatting

    I am very thankful for any kind of suggestions.

  5. #5
    Forum Contributor
    Join Date
    02-18-2013
    Location
    Berlin, Germany
    MS-Off Ver
    Excel 2016
    Posts
    221

    Re: read CSV file and create XLSX file with certain formatting

    Got it. Here's the code for future reference:

    Please Login or Register  to view this content.

+ 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. Replies: 3
    Last Post: 12-23-2022, 04:03 AM
  2. Replies: 5
    Last Post: 12-23-2022, 04:02 AM
  3. How to create connection xlsx file in tomcat servera(shared DIr)
    By kkrishnateja30 in forum Excel General
    Replies: 2
    Last Post: 03-15-2017, 01:16 PM
  4. Macro to create a copy of XlSB file and save as XLSX file without any formulas.
    By Mysore in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2016, 03:11 AM
  5. Replies: 3
    Last Post: 01-05-2014, 05:50 AM
  6. Replies: 4
    Last Post: 10-23-2013, 12:54 AM
  7. [SOLVED] How to Create a file in Excel that can't be copied or printed:read only file
    By enroh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-18-2006, 10:40 AM

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