Thread: Printing a list
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Nite Owl Sharon Nite Owl Sharon is offline
external usenet poster
 
Posts: 5
Default Printing a list

This is very close to what I want.
Is there also a way to incorporate the number of rows?
--
Nite Owl Sharon


"Gord Dibben" wrote:

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

With 1000 items, enter 10 if you want 10 columns of 100 cells snaked.

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 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 Thu, 12 Jul 2007 09:52:01 -0700, Nite Owl Sharon
wrote:

I have a list in alphabetical order of about 1,000 items which will continue
to update and grow.

I want to print them in columns similiar to newspaper style in MS Word
without cutting and pasting.

Can this be accomplished in Excel?