I have quite a few csv files which I'd like to load into individual worksheets, but without having to open and close the csv files every time I do it. Is this possible to do with VB somehow?
Thank you
I have quite a few csv files which I'd like to load into individual worksheets, but without having to open and close the csv files every time I do it. Is this possible to do with VB somehow?
Thank you
Last edited by luv2glyd; 10-04-2012 at 06:59 PM.
You either quit or become really good at it. There are no other choices.
I've used the "Import External Data" command (not sure where it is on the newer interface) successfully for this kind of thing.
OK, I found "import from text" under "data" tab, and manually it works fine, but when I go to record the macro excel just freezes.....
I'm not sure why the macro recorder freezes, but I would ask if you need to record a macro? If you've told Excel to "save query definition" (with or without the option to "prompt for file name on refresh"), it should then be as easy as making a copy of the tab, then right clicking on the data range, then editing the text import. If there are no surprises in the csv files, then all you should need to change in each tab/copy is the filename being referred to. I guess it depends on how many files you need to import, but I expect you could go through quite a few files manually (even though it is tedious) in the same amount of time it would take to write, test, and debug code to do it automatically.
I actually need to do this over and over 1000's of times. I restarted excel and it was able to record the macro.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks