one text column to several columns/table ?

B

- Bobb -

Occasionally I would like to print the contents of a big folder onto one
sheet of paper. ( TO scribble make notes etc. ) Often it's an entire
folder so I type "dir /b > pix.txt". ( remember DOS ? ) That gets me all
the filenames in one file that I open with Excel - and of course all the
data is in column A. Anyway in Excel to easily convert that into "as
many columns as it takes to print onto one sheet of paper" other than me
doing some math to figure how many columns I'd like and then cut/paste
into B, C , D etc ?
 
K

Kernow Girl

Hi Bobb - is there a reason not to use Print Preview / Setup / Fit to 1 page
wide ?
If your folder is very large the text might get quite small but you could
try by 1 high 2 wide, etc.
HTH - yours Dika
 
G

Gord Dibben

Bobb

Are you up for a macro?

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 not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.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 Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to Tool>Macro>Macros.

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


Gord Dibben MS Excel MVP

Occasionally I would like to print the contents of a big folder onto one
sheet of paper. ( TO scribble make notes etc. ) Often it's an entire
folder so I type "dir /b > pix.txt". ( remember DOS ? ) That gets me all
the filenames in one file that I open with Excel - and of course all the
data is in column A. Anyway in Excel to easily convert that into "as
many columns as it takes to print onto one sheet of paper" other than me
doing some math to figure how many columns I'd like and then cut/paste
into B, C , D etc ?

Gord Dibben MS Excel MVP
 
B

- Bobb -

That is what I do but I have to cut/paste 1/3 the data from col 1 into 2
new columns - preview -print.
It IS tiny, but I thought there might be an easier way to get the data
into 2,3,4,5, columns rather than me cut/pasting.
Thanks
 
B

- Bobb -

I'll try it out - but you didn't say what the output will look like :
how many columns etc

thanks
 
G

Gord Dibben

You choose the number of columns when the inputbox comes up.

Say you have 300 file names.

Pick a number like 6 which would give you 6 columns by 50 rows.

Should fit on a single sheet of paper.


Gord


I'll try it out - but you didn't say what the output will look like :
how many columns etc

thanks

Gord Dibben MS Excel MVP
 
Top