Hello,
I am looking to take two columns of data (A – Name, B –Number) that are around 130 rows each and split them into four even columnseach. (Ex: A,B A,B A,B A,B).I’ve looked around and found some VBA scripts that can split a single columninto many columns, but am unsure about how to do this with two columns. The twocolumns do correspond with each other and do need to stay matched up as well.
Any help or suggestions are appreciated. Thanks!
Here is the single column script I had found elsewhere.
Sub SplitInto15CellsPerColumn()
Dim X As Long, LastRow As Long, vArrIn As Variant, vArrOut As Variant
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
vArrIn = Range("A1:A" & LastRow)
ReDim vArrOut(1 To 15, 1 To Int(LastRow / 15) + 1)
For X = 0 To LastRow - 1
vArrOut(1 + (X Mod 15), 1 + Int(X / 15)) = vArrIn(X + 1, 1)
Next
Range("B1").Resize(15, UBound(vArrOut, 2)) = vArrOut
End Sub
I am looking to take two columns of data (A – Name, B –Number) that are around 130 rows each and split them into four even columnseach. (Ex: A,B A,B A,B A,B).I’ve looked around and found some VBA scripts that can split a single columninto many columns, but am unsure about how to do this with two columns. The twocolumns do correspond with each other and do need to stay matched up as well.
Any help or suggestions are appreciated. Thanks!
Here is the single column script I had found elsewhere.
Sub SplitInto15CellsPerColumn()
Dim X As Long, LastRow As Long, vArrIn As Variant, vArrOut As Variant
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
vArrIn = Range("A1:A" & LastRow)
ReDim vArrOut(1 To 15, 1 To Int(LastRow / 15) + 1)
For X = 0 To LastRow - 1
vArrOut(1 + (X Mod 15), 1 + Int(X / 15)) = vArrIn(X + 1, 1)
Next
Range("B1").Resize(15, UBound(vArrOut, 2)) = vArrOut
End Sub