+ Reply to Thread
Results 1 to 5 of 5

Import multiple sheets into open workbook

  1. #1
    Forum Contributor
    Join Date
    05-30-2013
    Location
    France
    MS-Off Ver
    2010
    Posts
    260

    Import multiple sheets into open workbook

    Hi,

    I've tried to modify the code I found here : http://www.excel-easy.com/vba/exampl...rt-sheets.html. The code runs through but nothing is happening (no error messages are displayed). I'm not quite sure what's going wrong (the files are present in the said directory). Any help would be great! Here's my code :

    Please Login or Register  to view this content.
    Thanks,
    amphi
    Last edited by amphinomos; 03-27-2014 at 11:23 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Import multiple sheets into open workbook

    Hi, I think maybe you need an additional \, that code is looking for files in C:\test\ which are named files_to_import*.xl??". I'd maybe suggest:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-30-2013
    Location
    France
    MS-Off Ver
    2010
    Posts
    260

    Re: Import multiple sheets into open workbook

    Thanks ragulduy! That solved one of the problems but now I get an "Object variable not set error" on this line...
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Import multiple sheets into open workbook

    You need to define what "sheet" is.

    I would also advise against using sheet as a variable name as it might clash with something already defined in the vba object model. mySheet would be better. Maybe try something like:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-30-2013
    Location
    France
    MS-Off Ver
    2010
    Posts
    260

    Re: Import multiple sheets into open workbook

    I just deleted "total" as you set the variable twice but other than that the code worked. Many many thanks.

+ 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. Import all sheets from closed workbook to the open workbook
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2013, 04:05 AM
  2. [SOLVED] Import multiple csv files into current workbook as separate sheets
    By santosh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-31-2013, 04:19 AM
  3. Collecting Data from multiple sheets of a workbook and import them into new workbook
    By tufanayd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-16-2009, 04:10 PM
  4. Replies: 0
    Last Post: 06-23-2009, 01:50 PM
  5. Replies: 2
    Last Post: 08-30-2007, 12:34 PM

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