A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi, I am trying to figure out how to take a single row of numbers in excel (591 cells, 1 number per cell) and split it into multiple rows containing three cells of numbers per row (197 rows of three columns per row). For example, if I have 9 cells in row 1 as: 1 2 3 4 5 6 7 8 9, I need to convert it to
1 2 3
4 5 6
7 8 9
With 1,2,3 ... 589,590,591 in Row 1 - "A1:VS1"
use the following VBA code...
'---
Sub ThreeAcross()
Dim Rng As Excel.Range
Dim Ndx As Long, RowNdx As Long
RowNdx = 2
Set Rng = Range("A1:VS1").Cells ' 1 to 591
Application.ScreenUpdating = False
For Ndx = 4 To 591 Step 3
Rng(1, Ndx).Resize(1, 3).Cut Destination:=Cells(RowNdx, 1)
RowNdx = RowNdx + 1
Next
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
'---
Result looks like...
it continues down to row 197...
'---
Nothing Left to Lose
https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU
(free excel programs)