I got the following macro that copy sheet1 A1:A6 to Sheet2 transpose but copy the same row with the count in column G of sheet 1. The macro must paste one paste under the other on sheet 2 but keeps on copying other the same lines.
Sub CountRows() Dim lastRow As Long Dim startCell As Range Dim i As Long Dim rowCount As Long
' Set the starting cell
Set startCell = Sheets("Sheet1").Range("G4")
' Find the last row in column G
lastRow = Sheets("Sheet1").Cells(Rows.Count, "G").End(xlUp).Row
' Calculate the row count
rowCount = lastRow - startCell.Row + 1
' Display the result
MsgBox "Number of rows: " & rowCount
' Copy the range "A1:A6"
Sheets("Sheet1").Range("A1:A6").Copy
' Start looping through the rows
For i = 1 To rowCount
' Paste the value in each row of a specific column (e.g., column A)
Sheets("Sheet2").Range("A" & i).PasteSpecial Transpose:=True
Next i
Application.CutCopyMode = False ' Clear the clipboard
End Sub
If someone can help