Several times a day I need to produce packing slips for tractor trailer loads of product shipped on pallets. There are usually 20 – 30+ packing slips for each load, one for each pallet, with one customer requiring two slips per pallet. The slips are numbered 1 of ___, 2 of ___, 3 of ___, etc. Is there a formula or macro that would make my job easier than manually entering the first number? (The “total” number is entered with a formula)
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Setting up pagination (2002 / rel 10)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Setting up pagination (2002 / rel 10)
- This topic has 21 replies, 3 voices, and was last updated 16 years, 12 months ago.
Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody Lounger -
WSk32rem
AskWoody Lounger -
WSHansV
AskWoody LoungerNovember 29, 2007 at 6:50 pm #1086263Make sure that the workbook is less than 100 KB. If it’s too big, create a zip file containing the workbook.
Below the area where you type a post or reply, there is a box labeled “Attach a file – 100k Max.”, with a Browse… button next to it. Just before clicking Post It, click the Browse… button and select the workbook or zip file. It will appear as an attachment to your reply.
-
-
WSk32rem
AskWoody Lounger-
WSHansV
AskWoody LoungerNovember 29, 2007 at 10:36 pm #1086304Thanks – the attachment worked. The situation is different from what I thought it was. You can use the following macro to print out slips; the macro looks at the value calculated in cell E28 and fills cell C28 with values 1, 2, …, etc. up to that value, and prints out the sheet for each value. You can specify multiple copies of each to be printed if you wish.
Sub PrintSlips()
Dim i As Integer
Dim n As Integer
n = Range("E28")
For i = 1 To n
Range("C28") = i
ActiveSheet.PrintOut Copies:=1 ' change if needed
Next i
End Sub -
WSk32rem
AskWoody Lounger -
WSk32rem
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSk32rem
AskWoody LoungerDecember 11, 2007 at 5:55 pm #1087824 -
WSHansV
AskWoody Lounger -
WSk32rem
AskWoody Lounger -
WSHansV
AskWoody LoungerDecember 12, 2007 at 3:42 pm #1088004 -
WSk32rem
AskWoody Lounger -
WSk32rem
AskWoody LoungerJanuary 4, 2008 at 8:50 pm #1091186OK, I’m back again. The pagination is working well with the two sheets on one page. Now I’m wondering if there is a way to have the top sheet number for the first half of the number of sheets needed and the bottom sheet number the last half? That would save me collating after they’re printed. Thanks!
-
WSHansV
AskWoody Lounger -
WSk32rem
AskWoody Lounger -
WSkiazd
AskWoody LoungerMay 29, 2008 at 10:36 pm #1110895This is a very interesting use of VBA and I have learned a great deal. One question though. If a person does not buy an even number (E22), how can you get the lower portion to print the correct number? For example if the client buys 57 items the top portion prints 1 of 57, the lower portion 29.5 of 57. Is the only alternative to make sure the client buys an even number
-
WSHansV
AskWoody LoungerMay 29, 2008 at 10:55 pm #1110898You could change the code as follows:
Sub PrintSlips()
Dim i As Integer
Dim n As Integer
n = Range("E22")
For i = 1 To (n + 1) 2
Range("C22") = i
Range("C49") = (n + 1) 2 + i
ActiveSheet.PrintOut Copies:=1 ' change if needed
Next i
End Sub
This will work for odd and even numbers. But because the total number of half pages is always even, you’ll get a superfluous last half page if the number in E22 is odd. You can simply discard that one.
-
-
-
-
WSk32rem
AskWoody LoungerMay 29, 2008 at 7:10 pm #1110848Okay, this macro worked great – up until today. If I specify more than one copy to be printed, I get an error on the second sheet as follows:
PCL XL error
Subsystem: KERNEL
Error: IllegalOperatorSequence
Operator: EndChar
Position: 47I have not made any changes to any of the files I set up using this macro. I edited the macro in one or two of the other files, changing the copies desired to “2” just to see if it was a problem with just one file. Any time I changed the copies desired to more than one, I got the above error message printed on the second page of the print out. Please advise. Thank you.
-
WSHansV
AskWoody LoungerMay 29, 2008 at 9:46 pm #1110869The error message that you mention is a printer driver error (in fact, a PCL 6 error), not an Excel error. See if there’s an updated driver for your printer. If not, you might check whether there’s a PCL 5 or PostScript driver for your printer – PCL 5 and PostScript are less “sensitive” then PCL 6.
-
WSk32rem
AskWoody Lounger
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer
by
WSmeyerbos
10 hours, 48 minutes ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
6 hours, 32 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
9 hours, 22 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
9 hours, 31 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
10 hours, 14 minutes ago -
Rufus is available from the MSFT Store
by
PL1
7 hours, 43 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
1 day, 10 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
16 hours, 58 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
13 hours, 9 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
1 day, 6 hours ago -
Office gets current release
by
Susan Bradley
1 day, 8 hours ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
2 days, 23 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
2 days, 7 hours ago -
Stop the OneDrive defaults
by
CWBillow
2 days, 23 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
3 days, 9 hours ago -
X Suspends Encrypted DMs
by
Alex5723
3 days, 11 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
3 days, 12 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
3 days, 12 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
3 days, 13 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
3 days, 1 hour ago -
Enabling Secureboot
by
ITguy
3 days, 8 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
3 days, 21 hours ago -
No more rounded corners??
by
CWBillow
3 days, 17 hours ago -
Android 15 and IPV6
by
Win7and10
3 days, 6 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
4 days, 9 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
4 days, 12 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
4 days, 7 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
4 days, 19 hours ago -
May preview updates
by
Susan Bradley
4 days, 7 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
3 days, 22 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.