(Solved) – Excel VBA – Do until loop – until all the rows are empty


I am not yet familiar with the VBA programming language and so far I can record and understand the macros, but making it myself is still quite difficult.

I am currently working on a print template (worksheetname “Horizontal”). The template must be filled with information which it receives from the worksheet “ZFA”. After the template is filled it will print and empty it and delete the row from “ZFA”. As I have to do this task many times a day I wanted to know if there is a possiblity to do this via a loop. So repeat the upper steps until colom c is empty in the worksheet “ZFA”.

The code i’m now using for filling in the template, printing and deleting the row is:

    Range("A2").Formula2R1C1 = "=ZFA!RC"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
    Selection.Delete Shift:=xlUp

So is it possible to repeat this task until colom C in the worksheet ZFA is empty?

Leave a Reply

Your email address will not be published. Required fields are marked *