Creating multiple columns from one column

  • Thread starter Thread starter bblatz
  • Start date Start date
B

bblatz

Hi,

I am stuck for an answer here so any help would be greatly appreciated.
What I'm trying to do is group 2 columns together and create two
columns of that group much like using the columns feature in word. I
would also like to have these columns alphabetized. It really isn't
important to me to be able to work with the file in columns, however I
would like to print with multiple columns to avoid having a 20 page
file to print.

Thanks
 
Sort the column first using Data>Sort

The run this macro to snake from top to bottom into as many columns as you
choose.

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
 
Back
Top