View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default Move Data from one column to many columns

Barb

This macro will snake the column into as many columns as you choose.

For 3000 rows enter 30 in the inputbox and get 30 columns of 100 rows.

You do the math.

Public Sub SplitToCols()
Dim NUMCOLS As Integer
Dim i As Integer
Dim colsize As Long
On Error GoTo fileerror

NUMCOLS = InputBox("Choose Final Number of Columns")
colsize = Int((ActiveSheet.UsedRange.Rows.Count + _
(NUMCOLS - 1)) / NUMCOLS)
For i = 2 To NUMCOLS
Cells((i - 1) * colsize + 1, 1).Resize(colsize, 1).Copy Cells(1, i)
Next i
Range(Cells(colsize + 1, 1), Cells(Rows.Count, 1)).Clear
fileerror:
End Sub


Gord Dibben MS Excel MVP

On Mon, 16 Jan 2006 06:23:03 -0800, "Barb"
wrote:

Great information, but I am a little confused as to "the code for excel" isnt
finished?
I see the part where I add my parameter info, but I cant find the code to
copy into my VB Editor.

And are you saying it would be easier to put the data in word and use that
marcro?

Barb

"JE McGimpsey" wrote:

See

http://www.mvps.org/dmcritchie/excel/snakecol.htm

In article ,
"Barb" wrote:

I have a spreadsheet with thousands of entries in one column.
I would like to have a macro that can move every 100 rows of data over to
the next column and so on.

Goal is to fill up pages so I can print less sheets filled up with data.