packing slip

J

jamiks

I need to make packing slips from an excel distribution list.

I would like to repeat the header rows on every sheet then copy or print 1
row at a time. Each row equals 1 packing slip's worth of information.

I need to either just print 2 each with this configuration or make a
separate sheet for every row in the list (including the header info each time
of course)

thank you
 
D

Dave Peterson

I used column A to determine the last row to print.

Option Explicit
Sub testme01()
Dim FirstRow As Long
Dim LastRow As Long
Dim iRow As Long
Dim wks As Worksheet

Set wks = Worksheets("sheet1")

With wks
FirstRow = 2
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

.Range(.Cells(FirstRow, "A"), .Cells(LastRow, "A")) _
.EntireRow.Hidden = True

For iRow = FirstRow To LastRow
.Rows(iRow).Hidden = False
.PrintOut copies:=2, preview:=True
.Rows(iRow).Hidden = True
Next iRow

.Cells.EntireRow.Hidden = False
End With
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top