Forum Discussion

  • Logaraj Sekar's avatar
    Logaraj Sekar
    Steel Contributor

    Try this

     

    Sub copy_data()

    Windows("Datasheet.xlsx").Activate
    Sheets("Dsheet").Select
    Range("A1").Select

    For i = 2 To 4
    Windows("Exportfile.xlsx").Activate
    Sheets("ESheet").Select
    Cells(i, 2).Select
    Selection.Copy
    Windows("Datasheet.xlsx").Activate
    Sheets("Dsheet").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(0, 1).Select
    Selection.PasteSpecial Paste:=xlPasteValues
    ActiveCell.Offset(0, -1).Select
    Selection.End(xlDown).Select
    Next
    Selection.End(xlUp).Select
    End Sub

Resources