I tried this in two different ways.
First, select the range of cells to copy, and select the range of destination to paste. Below is the code:
Sub PanelData()
Dim size As Integer
Dim i As Integer
Dim shrate As Worksheet
Dim shpanel As Worksheet
Set shrate = Sheets("Rate")
Set shpanel = Sheets("Panel")
size = shrate.Range("B4").End(xlDown).Row
shrate.Range(Cells(4, 2), Cells(size, 2)).Select
Selection.Copy
shpanel.Cells(1, 1).Value = size - 3
For i = 1 To 18
shpanel.Range(Cells(4, 1).Offset((i - 1) * (size - 3), 0), Cells(3, 1).Offset(i * (size - 3), 0)).Select
Selection.PasteSpecial Paste:=xlPasteValues
Selection.NumberFormat = "m/d/yyyy"
Next i
End Sub
Second, copy cells in the range, and paste to destination column one by one. Here is the code:
Sub LoopingCP()
Dim size As Integer
Dim shrate As Worksheet
Dim shpanel As Worksheet
Set shrate = Sheets(2)
Set shpanel = Sheets(4)
size = shrate.Cells(4, 2).End(xlDown).Row - 3
For x = 1 To 18
For i = 1 To size
shrate.Cells(i + 3, 2).Select
Selection.Copy
shpanel.Cells(x * (i + 3), 1).Select
Selection.PasteSpecial Paste:=xlPasteValues
Selection.NumberFormat = "m/d/yyyy"
Next i
Next x
End Sub
Neither of these attempts worked out. What did I do wrong?
Thanks