Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / March 2008

Tip: Looking for answers? Try searching our database.

Printing problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FiluDlidu - 30 Mar 2008 23:22 GMT
Hi all,

Let's say I have long list of data in columns A, B and C, which in the end
makes it a long skinny table.  I would like a print to "wrap" the table so
that it can go 3 or 4 times from the top to the bottom of the page (we'll
assume it's a landscape printing or an 11x17 sheet...), without losing the
continuity of the data and without having to physically move the existing
data residing in the A, B and C columns.

Any ideas???

Thanks,
Feelu.
Gord Dibben - 31 Mar 2008 01:19 GMT
There are a couple of ways to wrap the text.

Try this and see if it is what you need.

Snakes three columns to nine columns.

Public Sub Snake3to9()
Dim myRange As Range
Dim colsize As Long
Dim maxrow As Long
Const numgroup As Integer = 3
Const NUMCOLS As Integer = 9
   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, (numgroup - 1)).Address)
   myRange.Cut Destination:=ActiveSheet.Range("A1").Offset(0, _
   (NUMCOLS - numgroup))
   Range("A1").Select
   Cells.End(xlDown).Offset(1, 0).Select
   Set NextRange = Range(ActiveCell.Address & ":" _
           & ActiveCell.Offset(-colsize, (numgroup - 1)).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

>Hi all,
>
[quoted text clipped - 9 lines]
>Thanks,
>Feelu.
FiluDlidu - 31 Mar 2008 14:28 GMT
Gord,

Thanks a lot for your reply!  Now... this is a little much for me...  I have
a few questions:

Where in VB editor do I paste this code?

When and how does printing occur and how do I tell the printer that the code
needs to be read and apply to the print job?

Is there also a way to repeat the first two rows at the top of every column
on the print job?

Hope this is not too much asking...

Feelu

> There are a couple of ways to wrap the text.
>
[quoted text clipped - 48 lines]
> >Thanks,
> >Feelu.
Gord Dibben - 31 Mar 2008 22:15 GMT
Alt + F11 to open the VBEditor.  CTRL + r to open the Project Explorer.

Right-click on your workbook/project and Insert>Module.

Paste into that module.

The code only moves the 3 columns of data to 9 columns.

Printing and Print Setup is up to you.

Turn on the macro recorder when doing the print setup.

Gord

>Gord,
>
[quoted text clipped - 65 lines]
>> >Thanks,
>> >Feelu.
Jack Sons - 31 Mar 2008 15:06 GMT
Gord,

I tried to modify your code so it woud be applicable for the general case
that we have a range i columns wide wich we want to "snake" to j colums,
where j is a multiple (k*i) of i (without having blank columns). But I
failed.

Please be so kind to provide the code. Thanks in advance.

Jack Sons
The Netherlands

> There are a couple of ways to wrap the text.
>
[quoted text clipped - 48 lines]
>>Thanks,
>>Feelu.
Gord Dibben - 31 Mar 2008 22:52 GMT
Jack

Suggest you visit David McRitchie's site for his SnakeCols routine.

http://www.mvps.org/dmcritchie/excel/code/snakecol.txt

Gord

>Gord,
>
[quoted text clipped - 60 lines]
>>>Thanks,
>>>Feelu.
Jack Sons - 01 Apr 2008 00:09 GMT
Enormous! Thanks Gord.

Jack.

> Jack
>
[quoted text clipped - 73 lines]
>>>>Thanks,
>>>>Feelu.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.