ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print page (https://www.excelbanter.com/excel-programming/293595-print-page.html)

Jez[_5_]

Print page
 
I've set my page breaks and want a button to print
ceratin pages. How do I write this in the vba editor?

Frank Kabel

Print page
 
Hi
try something like
sub foo()
activesheet.printout from:=1, to:=3
end sub

and assign a button to this. You can replace the 'from' and 'to' number
with a variable


--
Regards
Frank Kabel
Frankfurt, Germany

Jez wrote:
I've set my page breaks and want a button to print
ceratin pages. How do I write this in the vba editor?



pikus

Print page
 
Sheets(1).PrintOut

or
Sheets("Sheet1").PrintOut

or
For x = 1 To 3
Sheets(x).PrintOut
Next x

- Piku

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 01:13 PM.

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