Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default split 1 column to 3 columns

I have a list of 500 movies sorted alphabeticaly in one column. How do I get
it into 3 columns?
change from:
a
b
c
d
e
f

Into:

a d
b e
c f
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default split 1 column to 3 columns

Your example has one column split into two columns in a snaking configuration.

Is this what you want or maybe 3 snaking columns?

a c e
b d f

Please post back or use this macro which allows you to choose how many columns
you want.

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

If you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".

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

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP


On Sun, 6 Jan 2008 16:05:00 -0800, rckymtntim
wrote:

I have a list of 500 movies sorted alphabeticaly in one column. How do I get
it into 3 columns?
change from:
a
b
c
d
e
f

Into:

a d
b e
c f


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 98
Default split 1 column to 3 columns

If you mean columns to row then :
copypaste special transpose.
--
Socrates said: I only know, I don''''t know nothing.
I say : I don''''t even know, I don''''t
know nothing.


"rckymtntim" wrote:

I have a list of 500 movies sorted alphabeticaly in one column. How do I get
it into 3 columns?
change from:
a
b
c
d
e
f

Into:

a d
b e
c f

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i split names in to two columns jesse Excel Discussion (Misc queries) 0 June 21st 07 05:03 PM
Split a date/time column into 2 columns RKMiller Excel Discussion (Misc queries) 1 December 19th 05 04:02 PM
split column into 4 columns Jack Excel Discussion (Misc queries) 3 November 15th 05 08:27 PM
Can Columns be split? Armyman Excel Discussion (Misc queries) 3 March 21st 05 11:15 PM
split a single column into 2 separate columns Eve Excel Worksheet Functions 2 March 14th 05 07:33 PM


All times are GMT +1. The time now is 03:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"