Brake in a loop

E

Einar

I have workbook with different prices depending on postal code found in
worksheet “addressâ€. Usually we print out more than 100 copies with both
name, address and corresponding price. I want to make a brake in the loop and
verify for every 20th copy.

The question is how?

The macro looks like this:

Sheets("Adress").Select
With Sheets("Adress")
.Range("A12").Copy Sheets("Intern forside").Range("BE14")
.Range("B12").Copy Sheets("Intern forside").Range("BE15")
.Range("C12").Copy Sheets("Intern forside").Range("BE16")
.Range("D12").Copy Sheets("Intern forside").Range("BE17")
.Range("E12").Copy Sheets("Intern forside").Range("BE18")
.Range("F12").Copy Sheets("Intern forside").Range("BE19")
.Range("G12").Copy Sheets("Intern forside").Range("BE20")
.Range("H12").Copy Sheets("Intern forside").Range("BE21")
End With

iEndRow = Sheets("Adress").Cells(Rows.Count, "A") _
.End(xlUp).Row

i = 14

With Sheets("Adress")
For Each cell In Range("A12:H" & iEndRow)
cell.Copy Sheets("Intern").Range("BE" & i)
i = i + 1
If i = 22 Then
Worksheets("Price").PrintOut Copies:=1, Collate:=True
i = 14
End If
Next cell
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top