+ Reply to Thread
Results 1 to 7 of 7

copy all workbooks in a folder to a different workbook

  1. #1
    Registered User
    Join Date
    11-15-2011
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    74

    copy all workbooks in a folder to a different workbook

    hi all,
    i was handed-over a VBA code which copies the 1st sheet of all workbooks in a folder to a different workbook.
    there are a few minor changes i wanted on this code.

    1) The folder also contains the workbook to which the other workbooks are to be copied. Quite obviously, we have to open the destination workbook and run the code to copy those files to this workbook. But what happens is, at the end an error message appears saying that the "destination" folder couldn't be opened. So i was trying to edit the code so that it wouldn't not try to open the 'destination" workbook.

    2) After all sheets have been copied, i want the original sheet to be active one and not the sheet which have been copied last.

    My code-
    Please Login or Register  to view this content.
    thanks in advance.
    Last edited by prajesh; 11-22-2011 at 01:36 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: copy all workbooks in a folder to a different workbook

    Hi prajesh
    JB has worked example here https://sites.google.com/a/madrocket...ssistant/files
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: copy all workbooks in a folder to a different workbook

    I went through your code. Try changing this line -
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and see if it solves your problem.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    11-15-2011
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: copy all workbooks in a folder to a different workbook

    hi arlette,

    thanks for your help but the problem persists.

    do u have any other ideas?

    thanks again..

  5. #5
    Registered User
    Join Date
    11-15-2011
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: copy all workbooks in a folder to a different workbook

    hi pike,
    i couldn't find the help i was expecting in JB's website. i have sent an email, though, specifying my problem.

    thanks.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: copy all workbooks in a folder to a different workbook

    Have a look at my code here. It's easily adaptable
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Registered User
    Join Date
    11-15-2011
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    74

    Re: copy all workbooks in a folder to a different workbook

    thanks roy!!!

+ 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