Sep 19 2022 07:57 AM
Hi all,
I have done this once, but I cannot remake the situation, hope someone can help me.
I need to print a number of reports with a specific execution date. (see file attached)
That date is found in cell B3 of worksheet "Werkbon"
On another worksheet (Planning) I have a list with all the workorders and the excecution date.
Now I need to fill in a workorder with that particular date of cell B3 (so the other fields in the report will LOOKUP), print that report, and fill in the next workorder with that particular date and print that report.
I know this is a loop function, but do not know where to start. Can anyone help me?
Sep 19 2022 08:52 AM
Sep 19 2022 12:44 PM
Please attach the updated workbook.
Sep 19 2022 11:25 PM
@Hans Vogelaar Here it is :)
Sep 20 2022 01:38 AM
SolutionThank you. Here is a macro:
Sub PrintReports()
Dim ws As Worksheet
Dim wt As Worksheet
Dim r As Long
Application.ScreenUpdating = False
Set ws = Worksheets("Sheet4")
Set wt = Worksheets("Werkbon")
r = 3
Do While ws.Range("A" & r).Value <> ""
wt.Range("B5").Value = "'" & ws.Range("A" & r).Value
wt.PrintOut
r = r + 1
Loop
Application.ScreenUpdating = True
End Sub
Sep 30 2022 02:58 AM
Sep 30 2022 03:00 AM
Do While ws.Range("A" & r).Value <> "" And ws.Range("A" & r).Value <> 0
Sep 20 2022 01:38 AM
SolutionThank you. Here is a macro:
Sub PrintReports()
Dim ws As Worksheet
Dim wt As Worksheet
Dim r As Long
Application.ScreenUpdating = False
Set ws = Worksheets("Sheet4")
Set wt = Worksheets("Werkbon")
r = 3
Do While ws.Range("A" & r).Value <> ""
wt.Range("B5").Value = "'" & ws.Range("A" & r).Value
wt.PrintOut
r = r + 1
Loop
Application.ScreenUpdating = True
End Sub