I have the following code which takes a source range (containing text and numbers) and cycles through it copying and pasting into the next column and moving the values down one row each time, the values that drop off the bottom are placed at the top of the newly pasted range ie
aaa1
aaa2
aaa3
aaa4
bbb1
bbb2
ccc1
ccc2
becomes
ccc2
aaa1
aaa2
aaa3
aaa4
bbb1
bbb2
ccc1
etc
This works well but I am trying to tweek it to skip a column each time, (ie a blank column between, the pasted ranges) but can only succeed in getting it to skip a column after the first. Any suggestions?
aaa1
aaa2
aaa3
aaa4
bbb1
bbb2
ccc1
ccc2
becomes
ccc2
aaa1
aaa2
aaa3
aaa4
bbb1
bbb2
ccc1
etc
This works well but I am trying to tweek it to skip a column each time, (ie a blank column between, the pasted ranges) but can only succeed in getting it to skip a column after the first. Any suggestions?
Code:
Sub Populate()
Dim oRange1 As Range
Dim startColumn1 As String
Dim rangeStart1 As Integer
Dim rangeEnd1 As Integer
Dim cellCount1 As Integer
Dim i1 As Integer
startColumn1 = "B"
rangeStart1 = 4
rangeEnd1 = 11
cellCount1 = rangeEnd1 - rangeStart1 + 1
For i1 = 1 To cellCount1 - 1
Set oRange1 = Worksheets("PROGRAM GRID").Range(startColumn1 & rangeStart1 & _
":" & startColumn1 & (rangeEnd1 - i1))
oRange1.Copy
oRange1.Offset(i1, i1).PasteSpecial xlPasteAll
Set oRange1 = Worksheets("PROGRAM GRID").Range(startColumn1 & (rangeEnd1 - i1 + 1) & _
":" & startColumn1 & rangeEnd1)
oRange1.Copy
oRange1.Offset((-1 * cellCount1) + i1, i1).PasteSpecial xlPasteAll
Next i1
End Sub