Auto increment print function

babyburk

New Member
Joined
Dec 17, 2008
Messages
43
Office Version
  1. 365
Platform
  1. Windows
I am doing the same type of thing as this here: Auto increment on print function.
Printing PO books. I want to print 001 through 050 this time. But the next time I print them, I want to start from 051 to 100. Not start from 001 again. So, how do I tell it what number to start at?
 
Last edited by a moderator:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I am doing the same type of thing. Printing PO books. I want to print 001 through 050 this time. But the next time I print them, I want to start from 051 to 100. Not start from 001 again. So, how do I tell it what number to start at?
Just set your loops at what values you want to start at, i.e.
VBA Code:
For x = 51 To 100
 
Upvote 0
This is the one that I am trying to use:

Sub PrintInvoice()
Dim x As Integer
Dim c As Variant
c = InputBox("NUMBER OF COPIES", "PRINT")
For x = 1 To c
Range("F5").Value = Range("F5").Value + 1
Sheet1.PrintOut
Next x
MsgBox "DONE PRINTING", vbOKOnly, "PRINT COMPLETED"
End Sub

Is there a way to simply have a box come up so you can type the first number in and it will print from that number on for the quantity of pages that you selected? The issue is that I will not be the one using this. I need to make it simple for the office personal to use.
 
Upvote 0
OK, I don't believe this is the kind of code you want then.
This appears to count the number of times a specific document is printed.
It appears that you want to print a specific set of pages within your document.

That is a very different question, and probably should be asked in its own, brand new thread.
 
Upvote 0
I don't think so. We are tying to print PO books for different people. I have 5 or so tabs in this document with different names on them. I simply want to pick a tab, place in a starting number, like 150, then say print 50 pages. The pages will then print the same tab but change the number per printed page. 151, 152, etc for 50 pages. Then, some time down the road, we will need to print more so we would start at 200 and print more. Each tab would be starting at different numbers based on how often those people go through POs.
 
Upvote 0
Obivously, that is not the same as the original question asked in this thread, or the original code would have worked for you with very minor tweaks.

The existing code already shows you how to prompt the user for a number and incorprorate that into your code:
Rich (BB code):
Dim c As Variant
c = InputBox("NUMBER OF COPIES", "PRINT")
So if you simply wanted to ask the user for another value, just follow the same process.

It isn't quite clear if you want to prompt the user for a starting number, or just pick up where you left off last time.
If you need to remember where you left off last time, you will need to store that number somewhere on the sheet, as you cannot dynamically store a changing number in VBA.
 
Upvote 0
So then you just set that number in your code.

Let's say that you are using the variable "s" for your starting number (use in an Input Box to prompt the user for its value, like shown in the original code).
Then, before the loop in your code, you can set that value like:
VBA Code:
Range("R5") = s

Then, within the loop, to increment the counter by 1 after printing you can have this line of code:
VBA Code:
Range("R5") = Range("R5") + 1
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top