Steve
Steve

Reputation: 67

Copy data to a specific cell range on another worksheet in excel

HI I have this code which works well to copy and append data to a separate worksheet however I want it to paste to a specific cell range in the destination sheet, how do I go about ammending it?

Sub SummurizeSheets()
    Dim ws As Worksheet

    Application.ScreenUpdating = False
    Sheets("Summary").Activate

    For Each ws In Worksheets
        If ws.Name <> "Summary" Then
            ws.Range("D2:D6, D8:D15").Copy
            Worksheets("Summary").Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)
        End If
    Next ws
End Sub

Upvotes: 4

Views: 28399

Answers (1)

David Zemens
David Zemens

Reputation: 53663

Modify this line so that it refers to the desired Worksheet and cell(s) address:

Worksheets("Summary").Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)

For example, this puts it on a worksheet named "Another Sheet Name" and in column F, instead of column C:

Worksheets("Another Sheet Name").Cells(Rows.Count, 6).End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)

Update: You are using a somewhat dynamic range already, in conjunction with the Offset method. If you have trouble getting this to paste the values to the desired location, let me know what that location is and I can give more detailed answer.

Upvotes: 3

Related Questions