+ Reply to Thread
Results 1 to 6 of 6

VBA: Clean CSV line break file (concatenate based on value)

  1. #1
    Registered User
    Join Date
    07-31-2018
    Location
    Copenhagen
    MS-Off Ver
    2013
    Posts
    30

    VBA: Clean CSV line break file (concatenate based on value)

    Dear all,

    I hope you can help me with a VBA code, that I need at work to clean up CSV files that contains line breaks and that are broken into multiple columns.

    I need the VBA to make sure that all cells in column A starts with XXX0000-XX-000000 (where 0=any number and X=any letter) and ends with a quotation mark.
    This way, I can easily split to columns, as intended.

    Right now, the CSV file is already split up into multiple columns for some rows AND multiple rows (see example in attached).

    I have explained what it looks like and what I need in the attached file, I hope that is okay, it is difficult to explain in free text.

    Thank you in advance,

    Kr Anders
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA: Clean CSV line break file (concatenate based on value)

    Can you show the expected results based on the attached sample file ?

  3. #3
    Registered User
    Join Date
    07-31-2018
    Location
    Copenhagen
    MS-Off Ver
    2013
    Posts
    30

    Re: VBA: Clean CSV line break file (concatenate based on value)

    Yes, of course. Hereby the result attached :-)
    Attached Files Attached Files

  4. #4
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA: Clean CSV line break file (concatenate based on value)

    Try below code ...
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  5. #5
    Registered User
    Join Date
    07-31-2018
    Location
    Copenhagen
    MS-Off Ver
    2013
    Posts
    30

    Re: VBA: Clean CSV line break file (concatenate based on value)

    Hi Nankw83,

    Thank you very much, the code works perfectly! :-)

    It is really appreciated, and will save me so much time in the future! Have a great day.

    kr Anders

  6. #6
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA: Clean CSV line break file (concatenate based on value)

    Glad to help & thanks for the added Rep.

    Please take a moment & mark this thread as [SOLVED] from the Thread Tools menu above your first post

+ 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. Import from a text file to excel / problem with line break
    By ddblumenthal in forum Excel General
    Replies: 16
    Last Post: 05-24-2019, 01:53 PM
  2. [SOLVED] Concatenate text with a line break
    By AnnieMcken in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-22-2014, 12:44 PM
  3. [SOLVED] Break excel 120k lines file into smaller 10k line Microsoft 97 files
    By ejdrouil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2014, 08:06 PM
  4. [SOLVED] Insert line break and format text with CONCATENATE (or &)
    By AnnieMcken in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-17-2014, 12:24 PM
  5. Line break using Concatenate
    By kys2000 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2007, 06:03 PM
  6. [SOLVED] Writing File in VBA with Unix line break
    By Steven Drenker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2006, 04:40 PM
  7. [SOLVED] line break in a cell-Is there a way to get the line break instead of a symbol?
    By luvgreen in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2005, 02:05 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