hi guy i hope help me the code is somthing wrong i try to transfer data of invoice from sheet1 to sheet 2
but give me this mistake RED LINE
AND GIVE ME RUN TIME ERROR13
Code
Option Explicit
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
[COLOR=#FF0000]SHEET2.Cells(erow, 6) = WorksheetFunction.Sum(Worksheets(SHEET2).Range("e3:e35"))' this line[/COLOR]
End Sub
Display More