Posts by giancarlo.g

    Thanks for getting back!


    I am in fact running this in Access. My goal is to add the field to the csv file before importing into an access database. Initially I was looking for a way to do it via VBA during the import step itself, however found this code (and suggestion) to do it beforehand, by using this code. Therefore, is there a way to achieve this by running the VBA in access?


    Thanks.

    hi,


    I found this code to add a column to a csv with the filename as the value, however when running this code on my Scenario, I am getting "Sub or Function not defined" for the 'Cells' function (line 14). I'm assuming I need to specify the file. (I tried 'fn.Cells', 'x.Cells',) but still no joy. Quite new to VBA, can you help? Thank you!


    Re: Add a column with file name while importing .csv file in vba


    hello,
    Maybe just write straight to the worksheet

    Hi, When running this code on my Scenario, I am getting "Sub or Function not defined" for the 'Cells' function (line 14). I'm assuming I need to specify the file. (I tried 'fn.Cells', 'x.Cells',) but still no joy. Quite new to VBA, can you help? Thank you!