airforceone
Board Regular
- Joined
- Feb 14, 2022
- Messages
- 201
- Office Version
- 2019
- 2016
- Platform
- Windows
good day to all!
I don't know if its the lack of sleep or what! but can't seems to find the problem
I'm trying to copy all records from sheet (source) to the lastrow of another sheet (target) with the following code
with the following error
(METHOD 1) - Run-time error 1004 - Application-Defined or Object-Defined error
(METHOD 2) - Run-time error 9 - Subscript out of range
I don't know if its the lack of sleep or what! but can't seems to find the problem
I'm trying to copy all records from sheet (source) to the lastrow of another sheet (target) with the following code
VBA Code:
For iLOOP = 2 To FinalRow
' METHOD 1
Worksheets("TARGET").Range("A" & TargetLastRow & ":" & TargetLastColumnLetter & TargetLastRow).Value = Worksheets("SOURCE").Range("A" & iLOOP & ":" & LastChar & iLOOP).Value
' METHOD 2
Worksheets("SOURCE").Range("A" & iLOOP & ":" & LColX00 & iLOOP).Copy Destination:=Worksheets("TARGET").Range("A" & TargetLastRow & ":" & TargetLastColumnLetter & TargetLastRow)
cTr = cTr + 1
Next
with the following error
(METHOD 1) - Run-time error 1004 - Application-Defined or Object-Defined error
(METHOD 2) - Run-time error 9 - Subscript out of range