I have 2 sheets and I want to copy the cells (
Sheet1 and paste them into
Sheet2 while transposing them and pasting them in every other column (
S4, etc. skipping a cell between).
Sub CopyData() Dim wsSrc As Worksheet Dim wsDst As Worksheet Set wsSrc = Worksheets("Sheet1") Set wsDst = Worksheets("Sheet2") wsSrc.Range("B18:B23").Copy wsDst.Offset(1, 1).Range("O4").PasteSpecial xlPasteValues, Transpose:=True Application.CutCopyMode = False End Sub
I’ve gotten it to transpose but I can’t find a way to have it skip the column when it pastes.
Thanks in advance!
Welcome to SO. Good first post.
There’s not a “skip/transpose” using the standard Copy/Paste method, so I think the best option would be to loop through your values and use an offset. This should do it…
Sub CopyData() Dim wsSrc As Worksheet, wsDst As Worksheet, aCell As Range, tOff As Long Set wsSrc = Worksheets("Sheet1") Set wsDst = Worksheets("Sheet2") For Each aCell In wsSrc.Range("B18:B23").Cells wsDst.Range("o4").Offset(0, tOff).Value = aCell.Value tOff = tOff + 2 Next aCell End Sub
If this works for you, please don’t forget to click