+ Reply to Thread
Results 1 to 6 of 6

Copy range A:7 - Z200 from all sheets and paste into summary sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    12-06-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    13

    Question Copy range A:7 - Z200 from all sheets and paste into summary sheet

    Hi all,

    This is my first post and I don't think it is too hard of a question but I need a macro to copy the range A:7-X200 of every worksheet within a workbook (Excel 2007) and paste it into a Summary Sheet. Also, could you show me in the macro anything I would need to change if the range changed unless it is simply change anywhere you see the range in the macro?

    Thanks!
    Last edited by cheesiepoof05; 12-06-2011 at 05:46 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Copy range A:7 - Z200 from all sheets and paste into summary sheet

    cheesiepoof05,

    Welcome to the forum!
    Here's some code to get you started. In your title you use A7:Z200 but in the post you state A7:X200. The code uses A7:X200, change as needed. the wsDestNm is the worksheet Destination Name, so it should be the name of the Summary Sheet.
    Sub tgr()
        
        Const strRange As String = "A7:X200"
        Const wsDestNm As String = "Summary"
        
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Sheets
            If ws.Name <> wsDestNm Then ws.Range(strRange).Copy Sheets(wsDestNm).Cells(Rows.Count, "A").End(xlUp).Offset(1)
        Next ws
        
    End Sub
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-06-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Copy range A:7 - Z200 from all sheets and paste into summary sheet

    Thanks for the code Tiger. I am getting an error though and when I debug it is highlighting the section "ws.Range(strRange).Copy Sheets(wsDestNm).Cells(Rows.Count, "A").End(xlUp).Offset(1)". Do you know why by chance? Thanks

    Quote Originally Posted by tigeravatar View Post
    cheesiepoof05,

    Welcome to the forum!
    Here's some code to get you started. In your title you use A7:Z200 but in the post you state A7:X200. The code uses A7:X200, change as needed. the wsDestNm is the worksheet Destination Name, so it should be the name of the Summary Sheet.
    Sub tgr()
        
        Const strRange As String = "A7:X200"
        Const wsDestNm As String = "Summary"
        
        Dim ws As Worksheet
        For Each ws In ActiveWorkbook.Sheets
            If ws.Name <> wsDestNm Then ws.Range(strRange).Copy Sheets(wsDestNm).Cells(Rows.Count, "A").End(xlUp).Offset(1)
        Next ws
        
    End Sub

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Copy range A:7 - Z200 from all sheets and paste into summary sheet

    There's a useful add-in at RonDeBruin's site.

    Code is also available I think

  5. #5
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Copy range A:7 - Z200 from all sheets and paste into summary sheet

    You'll get an error there if you don't have a worksheet named "Summary". Change wsDestNm as needed.

  6. #6
    Registered User
    Join Date
    12-06-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    13

    Thumbs up Re: Copy range A:7 - Z200 from all sheets and paste into summary sheet

    Tiger,

    I misread your post and titled my summary worksheet wsDestNm. Once I got that fixed it worked like a charm. A million thanks, you're the man!

+ 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