Forum Discussion

Celia9's avatar
Celia9
Brass Contributor
Sep 19, 2022
Solved

Loop a list based on condition and print

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 ...
  • HansVogelaar's avatar
    HansVogelaar
    Sep 20, 2022

    Celia9 

    Thank 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

Resources