Single record

Z

zigeuner

Is it possible to print a single record per page? I have a spreadshee
with 240 records and I want to be able to print a single record pe
page, preferably with the column headings vertically down the side.
have only a short time (about 20 hrs) to acheive this. :
 
D

Dave Peterson

How about a small macro to get you started:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim newWks As Worksheet
Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long

Set wks = Worksheets("sheet1")
Set newWks = Worksheets.Add

With wks
FirstRow = 2 'headers in row 1
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

.Rows(1).Copy
newWks.Range("a1").PasteSpecial Transpose:=True

For iRow = FirstRow To LastRow
newWks.Range("b1").EntireColumn.ClearContents
.Rows(iRow).Copy
newWks.Range("b1").PasteSpecial Transpose:=True
With newWks
.UsedRange.Columns.AutoFit
.UsedRange.Rows.AutoFit
With .PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
.PrintOut preview:=True
End With
Next iRow
End With

Application.DisplayAlerts = False
newWks.Delete
Application.DisplayAlerts = True

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
D

Dave Peterson

Ps. I use "preview:=true" to save paper. Get rid of that when you're ready to
kill a tree <bg>.
 
E

Earl Kiosterud

zigeuner,

When you say 240 records, I presume you mean 240 rows of data in a table
(sheet). Excel has no provision for changing the layout of a sheet. It
prints the sheet pretty much as is, with the perqs in File - Page setup.
But that won't take a single row at a time and spread it out on a page
vertically and horizontally, which I think you want.

Access can do this, and can use Excel data. That's a possibilty. Access is
terrific for laying out a printed report however you want it. You could
also lay it out in Word, and use mail merge.
 
Z

zigeuner

Thank you Dave and Earl. I have no managed it using the transpose
function, albeit without the macro Dave (I have saved it though). Earl
the Access option wouldn't work as the spreadsheet had some functions
embedded in cells that Access could make no sense of. Brian
 
D

Dave Peterson

Does that mean you copy and paste special|transpose 240 times???

You may want to play with that macro to see if it works for you.
 
Top