• 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.

Help with existing Vlookup macro

mporres77

New Member
Hello.

I am wondering if anyone can help me with this macro. It is assigned to a button.

I am trying to have the macro look for whatever number is in cell A4 Sheet 1, then go to Sheet 2, look for that same number in column A and paste the data from Sheet 1 Range A4:G4 where ever it found the number in Sheet 2.

The problem I am having is that right now my macro is pasting Sheet 1 Range A4:G4 in Sheet 2 in the last row that has data.

I can't seem to figure out how to get it to find the number in Sheet 2 and past the data in that row.


Here is what I have so far:
Sub VlookupA()

Application.ScreenUpdating = False
Dim j As Long
Dim SN As Long
Set myrange = Range("A:A")

j = Sheet5.Cells(Rows.Count, "A").End(xlUp).Row
On Error Resume Next
SN = Application.WorksheetFunction.VLookup(SN, myrange, 1, True)
On Error GoTo 0
Sheet1.Range("A4:G4").Copy
Sheet5.Range("A" & j).PasteSpecial xlValues
Application.CutCopyMode = False
Application.ScreenUpdating = False
End Sub

Thank you to anyone in advance for you help.
 

Attachments

  • Escalations Tier 1-Update & Escalate.xlsm
    88.9 KB · Views: 2
Back
Top