Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to print last page of sheet?
Hi,
I would like to print only the last page of a sheet with the simple click on a button, but I cannot find a way to program that. Thanks for any help on the subject. Kees |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to print last page of sheet?
Hi
Try this Sub Test() Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") ActiveSheet.PrintOut From:=TotPages, To:=TotPages End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "kcm" wrote in message ... Hi, I would like to print only the last page of a sheet with the simple click on a button, but I cannot find a way to program that. Thanks for any help on the subject. Kees |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to print last page of sheet?
Hi
use the following: Sub print_last Dim i As Integer i = ExecuteExcel4Macro("Get.Document(50)") ActiveWindow.SelectedSheets.PrintOut From:=i, To:=i, _ Copies:=1, Collate:=True End Sub -- Regards Frank Kabel Frankfurt, Germany "kcm" schrieb im Newsbeitrag ... Hi, I would like to print only the last page of a sheet with the simple click on a button, but I cannot find a way to program that. Thanks for any help on the subject. Kees |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to print last page of sheet?
Frank,
Nice trick, works fine. Thanks, Kees Frank Kabel wrote: Hi use the following: Sub print_last Dim i As Integer i = ExecuteExcel4Macro("Get.Document(50)") ActiveWindow.SelectedSheets.PrintOut From:=i, To:=i, _ Copies:=1, Collate:=True End Sub -- Regards Frank Kabel Frankfurt, Germany "kcm" schrieb im Newsbeitrag ... Hi, I would like to print only the last page of a sheet with the simple click on a button, but I cannot find a way to program that. Thanks for any help on the subject. Kees |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to print last page of sheet?
Ron,
Thanks. Is this documented somewhere? Kees Ron de Bruin wrote: Hi Try this Sub Test() Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") ActiveSheet.PrintOut From:=TotPages, To:=TotPages End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print one page per sheet | Excel Discussion (Misc queries) | |||
Active cell counting in particular print page (one sheet having different print area) | Excel Worksheet Functions | |||
How can I print a different header on each page of an Excel Sheet | Excel Discussion (Misc queries) | |||
How can I print page 2 of each sheet in a workbook? | Excel Discussion (Misc queries) | |||
Print excel sheet in one page | Excel Programming |