PrintOut Loop

Rostuse

New Member
Joined
Jan 15, 2021
Messages
18
Office Version
  1. 2016
Platform
  1. Windows
Dears,

I'm making a simple macro for ZPL printer. (But I'm not so good with it, it is my first time actually)
I have a code of 9 lines that needs to be printed (2nd sheet)
On the 1st sheet I have a Code of the product and Serial Number, start from X and stop until X.

The macro I am trying to make is to print the first serial number inserted, after that add +1 on the same and print it all until it meets the Stop Until X number.

VBA Code:
Sub Print_Loop()

Do Until Sheets("Foglio1").Range("A2") = Sheets("Foglio1").Range("A3")
    Sheets("Foglio2").Range("A1:A9").PrintOut
    MsgBox "Want to Continue?", vbOKCancel
    Sheets("Foglio1").Range("A2") = Sheets("Foglio1").Range("A2") + 1
Loop

End Sub

I will really appreciate for your help.

Thanks
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
You are welcome and thanks for letting me know.
If it isn't too much to ask, is it possible instead of from X to Y, Y to be lets say 10, and X changes 10 times?
Example: X=100, Y=5,
X changes 5 times +1.

Its perfect even like this, do not worry if its too much to change.

Thanks again !
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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