Vb Code not working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code only checks the first range and stops or prints. What is wrong? I would like it to continue to all 20 ranges check and skip or print.
Can you tell what is missing

Private Sub CommandButton34_Click(
Dim iRow As Lon
Dim HowMany As Lon

HowMany = 2

With ActiveShee
For iRow = 52 To (32 * HowMany - 1) + 52 Step 3
If IsNumeric(.Cells(iRow + 3, "I").Value) The
If .Cells(iRow + 3, "I").Value > 0 The
.Cells(iRow, "A").Resize(16, 9).PrintPrevie
'.printout when you're done checkin
Exit Fo
End I
End I
Next iRo
End Wit

Range("A1").Selec
End Su

Thank you very much.
 
Remove the "exit for"

IIRC, you're original code printed the first one that matched and didn't print
anymore.

(But it's been a couple of days <bg>.)
 
How do I include a header to print on each page. The header is at the
top of the first sheet.

Thank you,

Bob
 
One option would be to use the rows to repeat at top setting.

in page setup, on the last tab, look at the rows to repeat at top setting.

Turn on the macro recorder to see how to set it in code (set it manually
with the macro recorder turned on).
 

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

Back
Top