code transfer all of data & coordinate from sh1 to sh2

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,439
Office Version
  1. 2019
  2. 2010
Platform
  1. 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
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Glad you sorted it out & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,216,518
Messages
6,131,121
Members
449,624
Latest member
MandlaMan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top