Hi,
I am new on this forum and I hope it will help me learn VBA. I have some data that I would like to copy from 'ws1' to 'ws2'. The data in 'ws1' is displayed in rows, and I would like to paste it to 'ws2' in column D. Below is the code I wrote for the first row of data. I would like to repeat this for every row - I have 104 rows. Can someone help me figure out how to loop this? Thanks so much!
Sub copypaste()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim i As Integer
i = 3
Set ws1 = Sheets("profits_raw")
Set ws2 = Sheets("panel_US")
ws1.Activate
ws1.Range(Cells(i, 2), Cells(i, 17)).Copy
ws2.Activate
ws2.Range(Cells(i, 4), Cells(i, 4)).PasteSpecial Transpose:=True
'ws2.Range("D2:D17").PasteSpecial Transpose:=True
End Sub
Bookmarks