abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,507
- Office Version
- 2019
- 2010
- Platform
- Windows
hi guys
i have some datas and coordinates in sheet1 and i have macro buttons to transfer to sheet2
here my code doesn't well work transfer some of data but not all i would in every time to fill data in sheet1 transfer to sheet2 every thing data an coordinate like color
Sub transferData()
Dim i As Long
Dim Lastrow As Long
Dim erow As Long
Lastrow = Sheets("sheet1").Range("a" & Rows.Count).End(xlUp).Row
For i = 3 To Lastrow
erow = Sheets("sheet2").Range("a" & Rows.Count).End(xlUp).Offset(1, 0).Row
Range(Cells(i, 1), Cells(i, 6)).Copy Destination:=sheet2.Cells(erow, 1)
Next i
sheet2.Cells(erow, 6) = WorksheetFunction.Sum(Worksheets("sheet2").Range("e3:e35"))
End Sub
i have some datas and coordinates in sheet1 and i have macro buttons to transfer to sheet2
here my code doesn't well work transfer some of data but not all i would in every time to fill data in sheet1 transfer to sheet2 every thing data an coordinate like color
Sub transferData()
Dim i As Long
Dim Lastrow As Long
Dim erow As Long
Lastrow = Sheets("sheet1").Range("a" & Rows.Count).End(xlUp).Row
For i = 3 To Lastrow
erow = Sheets("sheet2").Range("a" & Rows.Count).End(xlUp).Offset(1, 0).Row
Range(Cells(i, 1), Cells(i, 6)).Copy Destination:=sheet2.Cells(erow, 1)
Next i
sheet2.Cells(erow, 6) = WorksheetFunction.Sum(Worksheets("sheet2").Range("e3:e35"))
End Sub