+ Reply to Thread
Results 1 to 6 of 6

Code for copying sheets from opened workbooks

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Code for copying sheets from opened workbooks

    Hi all,

    I'm looking for a code to loop through all opened workbooks and look whether there's a worksheet called wkly. sum.. If such a sheet exists, I would like it to be copied to a new workbook and rename the sheet to the name of the workbook from which it was copied from. If for example 3 workbooks contain a sheet named wkly. sum., I would like them all to be in one workbook at the end (not 3 workbooks).

    I hope I made myself clear :-)

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Code for copying sheets from opened workbooks

    as proof that im not lazy (just bad lol), I'll attach the code that i came up with

    Please Login or Register  to view this content.
    Last edited by Bishonen; 09-21-2012 at 05:54 AM.

  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: Code for copying sheets from opened workbooks

    So you need to check the workbooks open at that particular time on your system? Or do you want to check the workbooks which are in a folder?
    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
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Code for copying sheets from opened workbooks

    Quote Originally Posted by arlu1201 View Post
    So you need to check the workbooks open at that particular time on your system? Or do you want to check the workbooks which are in a folder?
    I would like to check all workbooks which are open at that particular time. I've updated the code in my second post (it makes sense to me, but it still won't work :/)

  5. #5
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Code for copying sheets from opened workbooks

    Does anyone have a spare minute to take a look @ the code i attached ? I got the feeling that I'm close to getting there (i manipulated the code here and there and I'm able to copy all desired sheets but I have to specifically tell where they shall go to (I have to know the names of the sheets where they come from too - which is a very bad thing ^^).

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

    Re: Code for copying sheets from opened workbooks

    This is your updated code
    Please Login or Register  to view this content.

+ 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