need a print macro to print only a certain number of pages

  • Thread starter Thread starter Tonso
  • Start date Start date
T

Tonso

i have a worksheet in which cell N10 counts the number of cells in
column D that have entries, and using an if statement, determines how
many pages need to be printed in order to print all rows that have
entries. The cell displays 1, 2, or 3 [pages], depending on the number
of rows that are filled in. For example, if the count is greater than
62, 2 pages have to be printed. If less than 62, only one page need be
printed. I have to do this because there are formulas in other rows
that go down all the way to the 169th row and 3 pages will be printed
out if i dont specify in the print range the number of pages i need
printed. Is it possible to have a macro use the cell value of 1 or 2 or
3 and then print only the matching required number of pages.

thanks

Tonso
 
Hi Tonso

You good amend this code

Sub print_1_2_3()
rowcount = Cells(Cells.Rows.Count, "a").End(xlUp).Row
If rowcount >= 62 Then
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True
End If
If rowcount < 62 Then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End If

End Su
 

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