+ Reply to Thread
Results 1 to 4 of 4

Rename csv file without losing its columns format

  1. #1
    Registered User
    Join Date
    02-19-2018
    Location
    Czech Republic
    MS-Off Ver
    Excel 2016
    Posts
    68

    Rename csv file without losing its columns format

    Hi all,

    I have a macro that is taking the complete path and name of a .csv file that is in A4 and then is making a copy of that file and save it to another location and also renames the csv file.

    The problem I have is, that the new csv file created is a mess. All the values I had in individual columns in the original file, appear all together in one column in the new file....

    Is there a way to keep the same csv column organization from the original file to the new one please?

    By the way, it is a must to copy and paste the file to another location without opening the original file, because it might be in use. I say this because surfing the net I saw other macros that are opening and saving as the file, but I can't do this.

    I attach you my actual code

    Please Login or Register  to view this content.
    Last edited by thorblow; 07-04-2023 at 04:39 AM.

  2. #2
    Registered User
    Join Date
    02-19-2018
    Location
    Czech Republic
    MS-Off Ver
    Excel 2016
    Posts
    68

    Re: Rename csv file without losing its columns format

    Hi all, I have just found a solution that works for me:

    Please Login or Register  to view this content.
    Therefore, I will change the status of this post as solved.

    Thank you!
    Last edited by thorblow; 07-04-2023 at 04:41 AM.

  3. #3
    Registered User
    Join Date
    02-19-2018
    Location
    Czech Republic
    MS-Off Ver
    Excel 2016
    Posts
    68

    Re: Rename csv file without losing its columns format

    Hi all,

    As a bonus, still I will add how to open a csv file through vba without changing the format.
    As you know, csv files are opened correctly when you open them by double click with the mouse but, when are opened through vba, the file is a mess.

    In order to solve this issue, the important instruction to add is "LOCAL".

    Please Login or Register  to view this content.
    Then you will be able to see the file csv as it should be.

  4. #4
    Registered User
    Join Date
    07-07-2023
    Location
    Colombo
    MS-Off Ver
    2016
    Posts
    3

    Re: Rename csv file without losing its columns format

    great!!!!!!!!

+ 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. Combining 2 columns into one without losing its format
    By fen-fen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-25-2022, 12:36 AM
  2. I am losing the format of a column when I ...
    By mrnoonan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-21-2020, 01:41 AM
  3. Converting from the 1904 date format to the 1900 date format without losing data
    By Patty McJorst in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-01-2020, 12:53 PM
  4. Copy chart and losing the format
    By wietzek in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-04-2019, 01:22 PM
  5. My File Rename Macro Always Doesn't Rename the Last Three files in the list
    By Enright in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2016, 03:46 PM
  6. Vba losing date format
    By Danny.Smythe in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-20-2015, 11:58 AM
  7. Losing format because of multiple IF statements
    By TJC123 in forum Excel General
    Replies: 4
    Last Post: 11-01-2008, 10:43 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