Loop through rows and copy paste one after another

LukiiMaxim96

New Member
Joined
May 18, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi! I got it almost working but I am stuck with the loop at the end of the code unfortunately.

I need to go through the rows of a worksheet one by one and copy the content to the last x rows of another column.
It works but I do not know how to tell the loop to go to the next row and copy that with each cycle until end is reached.

This is my code:

VBA Code:
Sub Test1()

Dim x As Integer
Dim lRow4C As Long
Dim lRow5F As Long

'count rows
lRow4C = Tabelle4.Range("C" & Rows.Count).End(xlUp).Row
nRows = Tabelle4.Range("C10", "C" & lRow4C).Rows.Count

Set CountaColumnsRange = Tabelle4.Range("K10:AH10")
    CountaColumnsResult = WorksheetFunction.CountA(CountaColumnsRange)

'copy paste start
lRow5F = Tabelle5.Range("F" & Rows.Count).End(xlUp).Row
Tabelle4.Range("C10").Copy
Tabelle5.Range("F" & lRow5F + 1, "F" & lRow5F + CountaColumnsResult).PasteSpecial xlPasteValues
Tabelle4.Range("C10").Select

'CopyPaste times rows counted loop
For x = 1 To nRows - 1
    lRow5F = Tabelle5.Range("F" & Rows.Count).End(xlUp).Row
    ActiveCell.Offset(1, 0).Copy
    Tabelle5.Range("F" & lRow5F + 1, "F" & lRow5F + CountaColumnsResult).PasteSpecial xlPasteValues
Next
     
End Sub

Any help is appreciated!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

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