+ Reply to Thread
Results 1 to 20 of 20

Copy from multiple sheets to one

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Copy from multiple sheets to one

    Hi
    I would like to copy from multiple sheets to one "summary".
    I would like to copy sheet “store1”, “store2”, and “store2” to my sheet“overview”. So we can have a complete overview for the sheets.

    My code is below...but its pasting the values to the right? I want it to paste i down.

    Does any know how? It would a great help for me.



    Please Login or Register  to view this content.
    Last edited by arlu1201; 07-08-2013 at 02:23 PM. Reason: Use code tags in future.

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

    Re: Copy from multiple sheets to one

    Try this
    Please Login or Register  to view this content.
    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]

  3. #3
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy from multiple sheets to one

    Hi thanks for for helping me out.

    It does not work.. I have changed the ranges to "A5:AC20" and it will only copy from one sheet ?

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy from multiple sheets to one

    FWIW:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy from multiple sheets to one

    Hi thanks

    still dont work . only copying one sheet. how come?

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy from multiple sheets to one

    Arlu's code loops through the sheets

    Please Login or Register  to view this content.
    What might not working is either you are copying the wrong range, or the paste area is going to a different column.

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

    Re: Copy from multiple sheets to one

    Or it could be that the sheets are not in the current workbook. Thisworkbook.Worksheets stresses that it should pick up the sheets in the current workbook where the code resides. You can remove the text "Thisworbook" if its a different workbook.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy from multiple sheets to one

    Arlu,
    You are right, but even if you omit thisworkbook, the code works on the active workbook.

  9. #9
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy from multiple sheets to one

    Hi
    all my sheets are in the same workbook so yeah it supposed to work because of the loop. I just dont know why. The code i posted does copy all the sheets and paste it to one. However it is pasting the values to the right :/
    Last edited by jiggaboi; 07-10-2013 at 02:55 AM.

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

    Re: Copy from multiple sheets to one

    Is your code residing in the same workbook where you have the sheets or in a different workbook?

  11. #11
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy from multiple sheets to one

    Yes look

    Capture.PNG

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy from multiple sheets to one

    A standard code should be stored in "Module" not worksheet. You put the code on the summary sheet. Remove it from the sheet and put it on a module, though the code could be run from the sheet and should work.

  13. #13
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy from multiple sheets to one

    Try this line

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy from multiple sheets to one

    I just forgot to mark the cursor on module. The code is stored in Module

  15. #15
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy from multiple sheets to one

    Have you tried my post #13?

  16. #16
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy from multiple sheets to one

    Hi thank you so much for help. Its working now. Dont know how.

    However i hope you guys can help me with a modication of the code. I would like it copy all sheets beside one and erease all data on summeray before pasting values from the other sheets.

    The code is so far

    Please Login or Register  to view this content.
    Last edited by arlu1201; 07-10-2013 at 02:11 PM.

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

    Re: Copy from multiple sheets to one

    jiggaboi,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.

  18. #18
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy from multiple sheets to one

    "Its working now. Don't know how"
    the paste special in bracket was wrong, hence I asked you to change it

    I am assuming you have a header in row 1

    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    07-08-2013
    Location
    denmark
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copy from multiple sheets to one

    Yes I have a header in Row 1

  20. #20
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy from multiple sheets to one

    And what is not working?

+ 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