+ Reply to Thread
Results 1 to 5 of 5

Importing multiple csv files into one sheet - Date error

  1. #1
    Registered User
    Join Date
    11-24-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    2

    Importing multiple csv files into one sheet - Date error

    I found a great bit of code from another user to import multiple csv files to one data sheet. However it is messing up the dates in some of the fields.
    Data is formatted in the csv as "dd/mm/yyyy hh:mm", however the macro is changing any fields where dd <= 12 to the format mm/dd/yyyy.

    Dates above 13th of each month format fine, it's just the first 12 that it's messing up. I would go through and manually import each sheet, but it's 1095 separate csv files!!
    Code i'm using is below. Any help is much appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,198

    Re: Importing multiple csv files into one sheet - Date error

    I think doing something like the following has worked for me in the past, trying to tweak your code to do the same

    Please Login or Register  to view this content.
    Let me know how you get on

  3. #3
    Registered User
    Join Date
    11-24-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    2

    Re: Importing multiple csv files into one sheet - Date error

    Worked perfectly. Thanks so much!

  4. #4
    Registered User
    Join Date
    05-12-2015
    Location
    AU
    MS-Off Ver
    2010
    Posts
    58

    Re: Importing multiple csv files into one sheet - Date error

    Hi,

    I tried the codes above but I encounter runtime error '9'

    Dim wsMstr As Worksheet: Set wsMstr = ThisWorkbook.Sheets("MasterCSV")
    Dim fPath As String: fPath = "h:\csvTest\" 'path to CSV files, include the final \

    I am running excel 2010 version.

    Thank you.

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,198

    Re: Importing multiple csv files into one sheet - Date error

    The obvious question is do you have a sheet called MasterCSV , in the workbook you are running the code from. Not Master CSV or any other combination!

+ 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. Importing multiple cvs-files to one sheet - Excel 2010
    By redone01 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 06-22-2016, 04:18 AM
  2. Importing Date from Multiple Files and date aquisition.
    By arpirnat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-14-2015, 11:07 AM
  3. [SOLVED] Help Importing Multiple Text files into one Excel Sheet
    By turpin_1980 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:42 AM
  4. Compile Error - Importing multiple CSV files via GetOpenFilename
    By lgjmac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2013, 08:48 AM
  5. Importing multiple large .csv files for analysis (Run Time Error - 7)
    By xxtoddyxx in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-11-2012, 11:36 AM
  6. Importing Multiple Text Files to one excel Sheet
    By thabounceisback in forum Excel General
    Replies: 1
    Last Post: 07-24-2012, 05:10 PM
  7. [SOLVED] Help required in importing multiple .txt files into one excel sheet
    By kar.chiranjib in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2012, 10:34 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