PrintOut Loop

Rostuse

New Member
Joined
Jan 15, 2021
Messages
13
Office Version
  1. 2013
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
 

GWteB

Well-known Member
Joined
Sep 10, 2010
Messages
1,295
Office Version
  1. 2013
Platform
  1. Windows
You are welcome and thanks for letting me know.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Rostuse

New Member
Joined
Jan 15, 2021
Messages
13
Office Version
  1. 2013
Platform
  1. Windows
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 !
 

Watch MrExcel Video

Forum statistics

Threads
1,130,149
Messages
5,640,400
Members
417,140
Latest member
whiteprose

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
Top