+ Reply to Thread
Results 1 to 4 of 4

Data shift with the letter "F" in csv files; macro that uploads multiple csv files

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Monterey, California
    MS-Off Ver
    Excel 2007
    Posts
    40

    Data shift with the letter "F" in csv files; macro that uploads multiple csv files

    My objective of the following macro is to import a number of csv files into one workbook as different worksheets within that workbook. Those worksheets are to be named the name of the file that is being imported. Here is the crux - any text that contains the letter "F" causes a shift in the data, almost as though I have specifed that the delimitter is the letter "F" (which I have not):

    Please Login or Register  to view this content.


    I have attached one of the csv files where I have added a number of extra letter "F" in the text. What am I missing??

    13C406C_QCDATA.csv


    When the files are selected in excel for opening (and the macro is not run) all data is placed in the appropriate fields without any problems.

  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: Data shift with the letter "F" in csv files; macro that uploads multiple csv files

    Here's an alternate macro that does the same thing, perhaps it will work correctly for you.


    'CSVs To Sheets
    A macro for importing all CSV files in a folder into a single Excel file, each CSV will be on a sheet of its own.
    CSVs to Sheets
    Last edited by JBeaucaire; 12-27-2019 at 04:58 AM.
    _________________
    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
    Registered User
    Join Date
    05-08-2013
    Location
    Monterey, California
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Data shift with the letter "F" in csv files; macro that uploads multiple csv files

    Jerry, I found a solution to the problem using my own code that I will present. I appreciate you sending the alternate macro and will check it out! Here is the revision that I made:

    Please Login or Register  to view this content.

    I don't understand why just setting the comma delimiter to true would not work, but it didn't. Setting it to false, and then specifying the other delimiter as a "," did work however. I hope this helps any others that may have found a similar problem.

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

    Re: Data shift with the letter "F" in csv files; macro that uploads multiple csv files

    If your question is resolved, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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