Forum Discussion
Bakhtawar A.
May 02, 2018Copper Contributor
loop in macro
how i transfer data from 1 sheet to another
- Logaraj SekarSteel 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