Same VBA in worksheet but different results EG: cell P1 8592701, cell P43 4451

Maureen Preece

New Member
Joined
Jun 21, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi - MY VBA is a print with consecutive numbers on each sheet printed, cell P1, but also in cell P43 I need to put in consecutive numbers, that are different then P1, then allow to print based on the numbers count in P1, the sheet is to be printed on the same A4 paper each side, hope this makes sense, new to this stuff.

Sub PrintJobs()
Dim i As Long, startnum As Long, lastnum As Long

startnum = Application.InputBox("Enter the first job number to be printed", "Print Job Number", 1, , , , , 1)
lastnum = Application.InputBox("Enter the last job number to be printed", "Print Job Number", 1, , , , , 1)

For i = startnum To lastnum
Range("P1").Value = i
ActiveWindow.SelectedSheets.PrintOut
Next

End Sub
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,215,334
Messages
6,124,321
Members
449,154
Latest member
pollardxlsm

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