Forum Discussion
jepollard
Apr 07, 2023Copper Contributor
Append portion of even number rows to odd number rows
Below are a few sample rows from an Excel 2019 file, created from a .CSV file. The Excel file contains records of the loan payment transactions for an auto loan. Each payment transaction takes up...
OliverScheurich
Apr 07, 2023Gold Contributor
Sub principal()
Dim i, j, k, l As Long
Range("G:L").Clear
k = 1
l = 1
j = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To j Step 2
Cells(k, 7).Value = Cells(l, 1).Value
Cells(k, 8).Value = Cells(l, 3).Value
Cells(k, 9).Value = Cells(l, 5).Value
l = l + 2
Cells(k, 10).Value = Cells(i, 1).Value
Cells(k, 11).Value = Cells(i, 3).Value
Cells(k, 12).Value = Cells(i, 5).Value
k = k + 1
Next i
End SubYou can try this code. In the attached file you can click the button in cell N2 to run the macro.
jepollard
Apr 09, 2023Copper Contributor
Ok, my inexperience has already caught up with me.
How do I get the contents of your cell N2 into a specific cell in my Excel file?
How do I get the contents of your cell N2 into a specific cell in my Excel file?