ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   need a print macro to print only a certain number of pages (https://www.excelbanter.com/excel-discussion-misc-queries/100127-need-print-macro-print-only-certain-number-pages.html)

Tonso

need a print macro to print only a certain number of pages
 
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


jetted

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

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 Sub


--
jetted
------------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
View this thread: http://www.excelforum.com/showthread...hreadid=562965


Tonso

need a print macro to print only a certain number of pages
 
Thanks Jetted!!

tonso
jetted wrote:
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 Sub


--
jetted
------------------------------------------------------------------------
jetted's Profile: http://www.excelforum.com/member.php...o&userid=17532
View this thread: http://www.excelforum.com/showthread...hreadid=562965




All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com