Hello,
I am working on a batch sheet for our lab. We use batch codes to give every recipe a unique code. We want a sheet that can be filled in by hand, so the batch codes need to be above the table, but changing this every time before printing will be an incredible inconvenience. I tried finding a solution online, but the code didn't work. I want to increase the value of b1, b11, b21 after printing by 3. These values are located in sheet4. I used the following code:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim i As Long
Cancel = True
Application.EnableEvents = False
Application.Dialogs(xlDialogPrinterSetup).Show
With Sheets("Blad4 (Batch)")
For i = 1 To .Range("B11").Value
For y = 1 To .Range("B21").Value
.Range("B1").Value = .Range("B1").Value + 3
.PrintOut
Next i
Next y
End With
Application.EnableEvents = True
End Sub
If someone has a suggestion to fix this, that would be amazing.
I really appreciate any help you can provide.
Test.xlsx
Bookmarks