+ Reply to Thread
Results 1 to 5 of 5

Loading contents of a csv file into workbook tab without opening the csv file

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Question Loading contents of a csv file into workbook tab without opening the csv file

    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.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,560

    Re: Loading contents of a csv file into workbook tab without opening the csv file

    I've used the "Import External Data" command (not sure where it is on the newer interface) successfully for this kind of thing.

  3. #3
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: Loading contents of a csv file into workbook tab without opening the csv file

    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.....

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,560

    Re: Loading contents of a csv file into workbook tab without opening the csv file

    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.

  5. #5
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: Loading contents of a csv file into workbook tab without opening the csv file

    I actually need to do this over and over 1000's of times. I restarted excel and it was able to record the macro.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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