Hi everyone,
I wrote a nested loop to transfer the values of each cell in a named range to another worksheet in the same workbook. However, it transfers only the value of the first cell in the range to the assigned cell in the recipient sheet. I have tried anything I could thing of such as defining the range as object instead of range but nothing works. Any help would be much appreciated!
The code should transfer the data from the named range "FPlannerM1" to the first available row in "ToSheet" in only one row, example A2 B2 C2 D2 etc, when the info in the range is changed, then the macro should do the same on; A3 B3 D3 and so on.
Sub mcrSaveRecord()
Dim RowFPArch As Range
Dim ItemC As Range
Dim i As Long
Dim Counter As Long
Set RowFPArch = Worksheets("FinancialPlanner").Range("FPlannerM1")
Counter = Worksheets("FinancialPlanner").Range("FPlannerM1").Count
Sheets("FPArch").Select
Range("A1048576").Select
Selection.End(xlUp).Select
For Each ItemC In RowFPArch
For i = 0 To (Counter - 1)
ActiveCell.Offset(1, i).Range("A1").Value = RowFPArch.Cells.Value
Next i
Next
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub
Bookmarks