View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.setup
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Can you print xcel in "newspaper colmn" fashion?

Joe

This macro will snake 4 columns into 12

Public Sub Snake4to12()
Dim myRange As Range
Dim colsize As Long
Dim maxrow As Long
Const numgroup As Integer = 3
Const NUMCOLS As Integer = 12
On Error GoTo fileerror
colsize = Int((ActiveSheet.UsedRange.Rows.Count + _
((NUMCOLS - 1)) / NUMCOLS)) / numgroup
MsgBox "Number of Rows to Move is: " & colsize
Range("A1").Select
With ActiveCell.Parent.UsedRange
maxrow = .Cells(.Cells.Count).Row + 1
End With
ActiveCell.Parent.Cells(maxrow, ActiveCell.Column) _
.End(xlUp).Offset(1, 0).Select
Set myRange = Range(ActiveCell.Address & ":" _
& ActiveCell.Offset(-colsize, (NUMCOLS - 1)).Address)
myRange.Cut Destination:=ActiveSheet.Range("A1") _
.Offset(0, ((NUMCOLS - 1) - numgroup))
Range("A1").Select
Cells.End(xlDown).Offset(1, 0).Select
Set NextRange = Range(ActiveCell.Address & ":" _
& ActiveCell.Offset(-colsize, (numgroup)).Address)
NextRange.Cut Destination:=ActiveSheet.Range("A1") _
.Offset(0, (NUMCOLS / numgroup))
Application.CutCopyMode = False
Range("A1").Select
fileerror:
End Sub


Gord Dibben MS Excel MVP


On Wed, 2 Aug 2006 12:42:10 -0700, JOE wrote:

I have a narrow (4 columns) but long (2200 rows) spreadsheet. I am trying to
print in multiple columns on one page (i.e. "newspaper colmns") before it
moves to page 2, etc. I am trying to avoid having 40 pages with one narrow
set of information on the page. I want it to print 2 or 3 "columns" on one
page before it moves to the next page.