• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to Copy & Paste Data Between Worksheets Using Date Lookup

moollaman

New Member
Hi all,

I'm very much a beginner when it comes to macros, so would appreciate any and all help you could provide!

I'm looking to create a macro that will copy the data in Sheet 4 (Daily Figures) and paste it into Sheet 5 (Tracking Sheet) for the corresponding date.

I took a look at this question & answer:

http://forum.chandoo.org/threads/copy-data-from-one-worksheet-to-another-using-vlookup-macro.21536/

I tried to alter what Nebu had done for my own purposes, but with no luck.

What I've got is:
Code:
Sub MoveDailyData()
Application.ScreenUpdating = False
Dim i, j As Date
j = Sheet5.Cells(Rows.Count, "A").End(xlUp).Row
i = Application.WorksheetFunction.Match(Sheet4.Range("A2"), Sheet5.Range("A2:A" & j), 0) + 1
Sheet4.Range("B2:K2").Copy
Sheet5.Range("B" & i).PasteSpecial xlValues
Application.CutCopyMode = False
Application.ScreenUpdating = False
End Sub

What am I doing wrong?

Thanks!
 

Attachments

  • Book1.xlsx
    81.3 KB · Views: 13
Back
Top